Browse Source

More cross compiling tweaks.

lagkey
T-bone 6 years ago
parent
commit
78629e7146
3 changed files with 44 additions and 22 deletions
  1. 3
    3
      CMake/SuperBuild.cmake
  2. 8
    2
      CMakeLists.txt
  3. 33
    17
      Modules/FDEM1D/examples/Hantenna.cpp

+ 3
- 3
CMake/SuperBuild.cmake View File

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/")

+ 8
- 2
CMakeLists.txt View File

45
 ########################################################################################## 
45
 ########################################################################################## 
46
 if (CMAKE_CROSSCOMPILING)
46
 if (CMAKE_CROSSCOMPILING)
47
     message ( STATUS "Cross-compiling! Only searching in install directory for components." )
47
     message ( STATUS "Cross-compiling! Only searching in install directory for components." )
48
+    # Kind of hack-ish, CMake doesn't always find this. It's buried in Cross compilation, so, 
49
+    # hopefully anyone doing this can problem solve. 
50
+    SET( CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX}/CMake ${CMAKE_INSTALL_PREFIX}/share/eigen3 )
51
+    #SET( CMAKE_MODULE_PATH ${CMAKE_INSTALL_PREFIX} )
48
     SET( CMAKE_FIND_ROOT_PATH ONLY ${CMAKE_INSTALL_PREFIX})
52
     SET( CMAKE_FIND_ROOT_PATH ONLY ${CMAKE_INSTALL_PREFIX})
49
     SET( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY  ONLY ) 
53
     SET( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY  ONLY ) 
50
     SET( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE  ONLY ) 
54
     SET( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE  ONLY ) 
51
     SET( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE  ONLY )
55
     SET( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE  ONLY )
52
     UNSET( Eigen3_DIR CACHE ) 
56
     UNSET( Eigen3_DIR CACHE ) 
53
     UNSET( yaml-cpp_DIR CACHE ) 
57
     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 
58
+    UNSET( Eigen3_FOUND CACHE ) 
59
+    UNSET( yaml-cpp_FOUND CACHE ) 
60
+    find_package (yaml-cpp 0.6 PATHS ${CMAKE_INSTALL_PREFIX} REQUIRED ) #QUIET )  # Serialisation of classes 
61
+    find_package (Eigen3 3.3 PATHS ${CMAKE_INSTALL_PREFIX} REQUIRED )   # QUIET)     # Matrix/Vector & Math
56
 endif()
62
 endif()
57
 
63
 
58
 find_package (Eigen3 3.3 QUIET)     # Matrix/Vector & Math
64
 find_package (Eigen3 3.3 QUIET)     # Matrix/Vector & Math

+ 33
- 17
Modules/FDEM1D/examples/Hantenna.cpp View File

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…
Cancel
Save