Trevor Irons 6 vuotta sitten
vanhempi
commit
e82ae1e149
4 muutettua tiedostoa jossa 50 lisäystä ja 29 poistoa
  1. 1
    1
      CMake/Mingw-Cross.cmake
  2. 3
    3
      CMake/SuperBuild.cmake
  3. 13
    8
      CMakeLists.txt
  4. 33
    17
      Modules/FDEM1D/examples/Hantenna.cpp

+ 1
- 1
CMake/Mingw-Cross.cmake Näytä tiedosto

37
 #set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
37
 #set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
38
 #Static Libs
38
 #Static Libs
39
 #Set Linker flags
39
 #Set Linker flags
40
-set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
40
+set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")

+ 3
- 3
CMake/SuperBuild.cmake Näytä tiedosto

15
 		#INSTALL_COMMAND     ""
15
 		#INSTALL_COMMAND     ""
16
     )
16
     )
17
 
17
 
18
-    message("Source dir of myExtProj = ${SOURCE_DIR}")   
19
-    ExternalProject_Get_property(EIGEN SOURCE_DIR)
20
-    message("Source dir of myExtProj = ${SOURCE_DIR}")   
18
+    #message("Source dir of myExtProj = ${SOURCE_DIR}")   
19
+    #ExternalProject_Get_property(EIGEN SOURCE_DIR)
20
+    #message("Source dir of myExtProj = ${SOURCE_DIR}")   
21
  
21
  
22
     # Are these necessary?
22
     # Are these necessary?
23
     #include_directories ("${CMAKE_INSTALL_PREFIX}/include/eigen3/")
23
     #include_directories ("${CMAKE_INSTALL_PREFIX}/include/eigen3/")

+ 13
- 8
CMakeLists.txt Näytä tiedosto

22
 ########################################
22
 ########################################
23
 
23
 
24
 ## Options--what do you want to do
24
 ## Options--what do you want to do
25
-
26
 option ( BUILD_SHARED_LIBS      "Shared or static libraries"  OFF )
25
 option ( BUILD_SHARED_LIBS      "Shared or static libraries"  OFF )
27
-set(CMAKE_BUILD_TYPE "Release" STRING
28
-       "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
29
-       FORCE cache)
30
-set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Debug Release RelWithDebInfo MinSizeRel )
31
- 
26
+
27
+IF( NOT CMAKE_BUILD_TYPE )
28
+   SET( CMAKE_BUILD_TYPE Release ... FORCE )
29
+ENDIF()
30
+
32
 option ( LEMMA_ENABLE_TESTING       "Turn on unit testing" OFF )
31
 option ( LEMMA_ENABLE_TESTING       "Turn on unit testing" OFF )
33
 option ( LEMMA_BUILD_EXAMPLES       "Compile example Lemma applications" OFF )
32
 option ( LEMMA_BUILD_EXAMPLES       "Compile example Lemma applications" OFF )
34
 option ( LEMMA_USE_OPENMP           "Use OpenMP in Lemma" OFF )
33
 option ( LEMMA_USE_OPENMP           "Use OpenMP in Lemma" OFF )
45
 ########################################################################################## 
44
 ########################################################################################## 
46
 if (CMAKE_CROSSCOMPILING)
45
 if (CMAKE_CROSSCOMPILING)
47
     message ( STATUS "Cross-compiling! Only searching in install directory for components." )
46
     message ( STATUS "Cross-compiling! Only searching in install directory for components." )
47
+    # Kind of hack-ish, CMake doesn't always find this. It's buried in Cross compilation, so, 
48
+    # hopefully anyone doing this can problem solve. 
49
+    SET( CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX}/CMake ${CMAKE_INSTALL_PREFIX}/share/eigen3 )
50
+    #SET( CMAKE_MODULE_PATH ${CMAKE_INSTALL_PREFIX} )
48
     SET( CMAKE_FIND_ROOT_PATH ONLY ${CMAKE_INSTALL_PREFIX})
51
     SET( CMAKE_FIND_ROOT_PATH ONLY ${CMAKE_INSTALL_PREFIX})
49
     SET( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY  ONLY ) 
52
     SET( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY  ONLY ) 
50
     SET( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE  ONLY ) 
53
     SET( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE  ONLY ) 
51
     SET( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE  ONLY )
54
     SET( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE  ONLY )
52
     UNSET( Eigen3_DIR CACHE ) 
55
     UNSET( Eigen3_DIR CACHE ) 
53
     UNSET( yaml-cpp_DIR CACHE ) 
56
     UNSET( yaml-cpp_DIR CACHE ) 
54
-    find_package (Eigen3 3.3 )# QUIET)     # Matrix/Vector & Math
55
-    find_package (yaml-cpp 0.6 ) #QUIET )  # Serialisation of classes 
57
+    UNSET( Eigen3_FOUND CACHE ) 
58
+    UNSET( yaml-cpp_FOUND CACHE ) 
59
+    find_package (yaml-cpp 0.6 PATHS ${CMAKE_INSTALL_PREFIX} ) #QUIET )  # Serialisation of classes 
60
+    find_package (Eigen3 3.3 PATHS ${CMAKE_INSTALL_PREFIX}  )   # QUIET)     # Matrix/Vector & Math
56
 endif()
61
 endif()
57
 
62
 
58
 find_package (Eigen3 3.3 QUIET)     # Matrix/Vector & Math
63
 find_package (Eigen3 3.3 QUIET)     # Matrix/Vector & Math

+ 33
- 17
Modules/FDEM1D/examples/Hantenna.cpp Näytä tiedosto

27
 #include "FDEM1D"
27
 #include "FDEM1D"
28
 #include "timer.h"
28
 #include "timer.h"
29
 
29
 
30
+#if defined(__clang__)
31
+	/* Clang/LLVM. ---------------------------------------------- */
32
+    const char* compiler = "clang";
33
+#elif defined(__ICC) || defined(__INTEL_COMPILER)
34
+	/* Intel ICC/ICPC. ------------------------------------------ */
35
+    const char* compiler = "icpc";
36
+
37
+#elif defined(__GNUC__) || defined(__GNUG__)
38
+	/* GNU GCC/G++. --------------------------------------------- */
39
+    const char* compiler = "gcc (GCC) "  __VERSION__;
40
+
41
+#elif defined(_MSC_VER)
42
+	/* Microsoft Visual Studio. --------------------------------- */
43
+    const char* compiler = "msvc " _MSC_FULL_VER;
44
+
45
+#elif defined(__PGI)
46
+	/* Portland Group PGCC/PGCPP. ------------------------------- */
47
+    const char* compiler = "pgc";
48
+#endif
49
+
30
 using namespace Lemma;
50
 using namespace Lemma;
31
 
51
 
32
 std::vector<Real>  readinpfile(const std::string& fname);
52
 std::vector<Real>  readinpfile(const std::string& fname);
35
 
55
 
36
 int main(int argc, char** argv) {
56
 int main(int argc, char** argv) {
37
 
57
 
38
-    std::cout <<
39
-    "\n"
40
-    << "Hantenna \n\n"
41
-    << "Hantenna is a programme for computing the H field from polygonal wire\n"
42
-    << "loop sources \n\n"
43
-    << "Hantenna was built using Lemma (Lemma is an Electromagnetics Modelling API)\n"
44
-    << "Lemma is Free and Open Source Software (FOSS) and is released under\n"
45
-    << "the MPL, it is covered by the following copyrights:\n"
46
-    << "Copyright (C) 2009, 2010, 2011, 2012, 218      Trevor P. Irons\n"
47
-    << "Copyright (C) 2011, 2012                       M. Andy Kass\n\n"
58
+const char *buildString = __DATE__ ", " __TIME__;
59
+    std::cout
60
+    << "===========================================================================\n"
61
+    << "Lemma " << LEMMA_VERSION << "\n"
62
+    << "[" << compiler << " " <<  buildString << "]\n"
63
+    << "This program is part of Lemma, a geophysical modelling and inversion API. \n"
64
+    << "     This Source Code Form is subject to the terms of the Mozilla Public\n"
65
+    << "     License, v. 2.0. If a copy of the MPL was not distributed with this\n"
66
+    << "     file, You can obtain one at http://mozilla.org/MPL/2.0/. \n"
67
+    << "Copyright (C) 2018 Lemma Software \n"
48
     << "More information may be found at: https://lemmasoftware.org\n"
68
     << "More information may be found at: https://lemmasoftware.org\n"
49
-    << "                                     info@lemmasoftware.org\n\n"
50
-    << "=====================================================================\n"
51
-    << "This programme is part of Lemma, a geophysical modelling and inversion API \n"
52
-    << "This Source Code Form is subject to the terms of the Mozilla Public\n"
53
-    << "License, v. 2.0. If a copy of the MPL was not distributed with this\n"
54
-    << "file, You can obtain one at http://mozilla.org/MPL/2.0/. \n"
55
-    << "=====================================================================\n\n\n";
69
+    << "                                     info@lemmasoftware.org\n"
70
+    << "===========================================================================\n\n"
71
+    << "Hantenna calculates the harmonic H field from polygonal wire loop sources\n";
56
 
72
 
57
     if (argc < 5) {
73
     if (argc < 5) {
58
         std::cout << "usage: hantenna.exe  trans.inp cond.inp points.inp config.inp \n";
74
         std::cout << "usage: hantenna.exe  trans.inp cond.inp points.inp config.inp \n";

Loading…
Peruuta
Tallenna