CRPropa / CRPropa3

CRPropa is a public astrophysical simulation framework for propagating extraterrestrial ultra-high energy particles. https://crpropa.github.io/CRPropa3/
https://crpropa.desy.de
GNU General Public License v3.0
71 stars 69 forks source link

CRPropa installation macOS 10.12.6 #137

Closed lyang54 closed 7 years ago

lyang54 commented 7 years ago

When trying to install CRPropa3.0 on my computer with macOS 10.12.6. After "cmake", I am trying to make, and getting the error

[ 39%] Building CXX object CMakeFiles/crpropa.dir/src/Random.cpp.o g++: error: unrecognized command line option ‘-stdlib=libc++’ make[2]: [CMakeFiles/crpropa.dir/src/Random.cpp.o] Error 1 make[1]: [CMakeFiles/crpropa.dir/all] Error 2

I am wondering if you have any clue about this and what I should do with this. Thanks a lot for your kind help.

rafaelab commented 7 years ago

I see that you are compiling with g++ instead of Mac's native clang. In this case, you have to provide the right flag to the compiler. So when using cmake you should probably add -stdlib=libstdc++.

lyang54 commented 7 years ago

I tried with cmake -stdlib=libstdc++ -DENABLE_OPENMP=ON .. But it gets some "Failed", do you have any idea how to solve this? Thanks.

-- Try OpenMP C flag = [-fopenmp=libomp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [ ] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-fopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [/openmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-Qopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-openmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-xopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [+Oopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-qsmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-mp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-fopenmp=libomp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [ ] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-fopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [/openmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-Qopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-openmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-xopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [+Oopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-qsmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-mp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Could NOT find OpenMP (missing: OpenMP_C_FLAGS OpenMP_CXX_FLAGS) -- Google perftools: NOT Found!

rafaelab commented 7 years ago

Assuming yours is a regular OSX 10.12.6 installation, could you try the following: cmake ..   -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_FLAGS="-stdlib=libstdc++" This is redundant, but it enforces the usage of default OSX compiler with the appropriate flag.

There's a chance that this will conflict with ROOT depending on how ROOT is compiled. If some error message about ROOT pops up, try adding to the above line the following: -DENABLE_ROOT=False

Please let me know if this works.

lyang54 commented 7 years ago

With or without -DENABLE_ROOT=False, both providing the error as before. I have the root version of 6.10.8, and regular OSX.

Using provided EIGEN -- Try OpenMP C flag = [-fopenmp=libomp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [ ] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-fopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [/openmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-Qopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-openmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-xopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [+Oopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-qsmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-mp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-fopenmp=libomp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [ ] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-fopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [/openmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-Qopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-openmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-xopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [+Oopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-qsmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-mp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Could NOT find OpenMP (missing: OpenMP_C_FLAGS OpenMP_CXX_FLAGS)

rafaelab commented 7 years ago

I have the same system and cannot reproduce your error. Could you paste the whole output of cmake?

lyang54 commented 7 years ago

cmake .. -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_FLAGS="-stdlib=libstdc++" -DENABLE_ROOT=False

-- Checking whether Fortran compiler has -isysroot -- Checking whether Fortran compiler has -isysroot - yes -- Checking whether Fortran compiler supports OSX deployment target flag -- Checking whether Fortran compiler supports OSX deployment target flag - yes -- Build Type: Release -- CRPropa version: 3.1-58-g73c4fa8 73c4fa83cf3b38f21466d84ff54c7f677ddbf714 refs/heads/master Using provided EIGEN -- Try OpenMP C flag = [-fopenmp=libomp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [ ] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-fopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [/openmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-Qopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-openmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-xopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [+Oopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-qsmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-mp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-fopenmp=libomp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [ ] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-fopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [/openmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-Qopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-openmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-xopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [+Oopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-qsmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-mp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Could NOT find OpenMP (missing: OpenMP_C_FLAGS OpenMP_CXX_FLAGS) -- Google perftools: NOT Found! -- Include: GOOGLE_PERFTOOLS_INCLUDE_DIR-NOTFOUND -- FFTW3 with single precision (FFTW3F): NOT Found! -- Include: FFTW3F_INCLUDE_DIR-NOTFOUND -- Library: FFTW3F_LIBRARY-NOTFOUND -- Quimby: NOT Found! -- Include: QUIMBY_INCLUDE_DIR-NOTFOUND -- Library: QUIMBY_LIBRARY-NOTFOUND -- SAGA: NOT Found! -- Include: SAGA_INCLUDE_DIR-NOTFOUND -- Library: SAGA_LIBRARY-NOTFOUND -- muParser: NOT Found! -- Include: MUPARSER_INCLUDE_DIR-NOTFOUND -- Library: MUPARSER_LIBRARY-NOTFOUND -- Use absolute RPATH /usr/local/lib -- Downloading data file from crpropa.desy.de ~ 50 MB -- Extracting data file -- Using user provided Python library: /Users/Lili/anaconda/lib/libpython2.7.dylib -- Python: Found! -- Version: 2.7/27 -- Executeable: /Users/Lili/anaconda/bin/python -- Include: /Users/Lili/anaconda/include/python2.7 -- Library: /Users/Lili/anaconda/lib/libpython2.7.dylib -- Site-package directory: /usr/local/lib/python2.7/site-packages -- Found numpy headers in /Users/Lili/anaconda/lib/python2.7/site-packages/numpy/core/include -- Configuring done -- Generating done -- Build files have been written to: /Users/Lili/Desktop/Google Drive/CRPropa3/build

rafaelab commented 7 years ago

I see that the build is complete. It is just no finding the proper OpenMP flags. If you try running make && make install it should compile. Or have your tried this already?

In any case, you might want to clean the build folder and use cmake again. If you have problems. please provide me the full output immediately after running cmake.

lyang54 commented 7 years ago

I tried this and it was not complete with 2 errors.

ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: [libcrpropa.dylib] Error 1 make[1]: [CMakeFiles/crpropa.dir/all] Error 2 make: *** [all] Error 2

rafaelab commented 7 years ago

Can you provide me the cmake output of a clean installation (the one you run for the first time after cleaning the build folder)?

lyang54 commented 7 years ago

Sure, please find below. Thanks a lot for your time.

cmake .. -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_FLAGS="-stdlib=libstdc++" -- The Fortran compiler identification is GNU 4.9.2 -- The C compiler identification is AppleClang 9.0.0.9000038 -- The CXX compiler identification is AppleClang 9.0.0.9000038 -- Checking whether Fortran compiler has -isysroot -- Checking whether Fortran compiler has -isysroot - yes -- Checking whether Fortran compiler supports OSX deployment target flag -- Checking whether Fortran compiler supports OSX deployment target flag - yes -- Check for working Fortran compiler: /usr/local/bin/gfortran -- Check for working Fortran compiler: /usr/local/bin/gfortran -- works -- Detecting Fortran compiler ABI info -- Detecting Fortran compiler ABI info - done -- Checking whether /usr/local/bin/gfortran supports Fortran 90 -- Checking whether /usr/local/bin/gfortran supports Fortran 90 -- yes -- Check for working C compiler: /usr/bin/clang -- Check for working C compiler: /usr/bin/clang -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/clang++ -- Check for working CXX compiler: /usr/bin/clang++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Build Type: Release -- CRPropa version: 3.1-58-g73c4fa8 73c4fa83cf3b38f21466d84ff54c7f677ddbf714 refs/heads/master -- Looking for pthread.h -- Looking for pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - found -- Found Threads: TRUE
Using provided EIGEN -- ROOT: Found! -- CFlags: -pthread -stdlib=libc++ -std=c++11 -m64 -I/usr/local/include -- Libs: -L/usr/local/lib -lCore -lImt -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lTreePlayer -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lMultiProc -lpthread -stdlib=libc++ -lm -ldl -- Try OpenMP C flag = [-fopenmp=libomp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [ ] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-fopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [/openmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-Qopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-openmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-xopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [+Oopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-qsmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-mp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-fopenmp=libomp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [ ] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-fopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [/openmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-Qopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-openmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-xopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [+Oopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-qsmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-mp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP Fortran flag = [-fopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Success -- Could NOT find OpenMP (missing: OpenMP_C_FLAGS OpenMP_CXX_FLAGS) -- Google perftools: NOT Found! -- Include: GOOGLE_PERFTOOLS_INCLUDE_DIR-NOTFOUND -- FFTW3 with single precision (FFTW3F): NOT Found! -- Include: FFTW3F_INCLUDE_DIR-NOTFOUND -- Library: FFTW3F_LIBRARY-NOTFOUND -- Quimby: NOT Found! -- Include: QUIMBY_INCLUDE_DIR-NOTFOUND -- Library: QUIMBY_LIBRARY-NOTFOUND -- SAGA: NOT Found! -- Include: SAGA_INCLUDE_DIR-NOTFOUND -- Library: SAGA_LIBRARY-NOTFOUND -- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.1") -- muParser: NOT Found! -- Include: MUPARSER_INCLUDE_DIR-NOTFOUND -- Library: MUPARSER_LIBRARY-NOTFOUND -- Found ZLIB: /Users/Lili/anaconda/lib/libz.dylib (found version "1.2.11") -- Found HDF5: /Users/Lili/anaconda/lib/libhdf5.dylib;/Users/Lili/anaconda/lib/libhdf5_hl.dylib;/Users/Lili/anaconda/lib/libhdf5.dylib;/Users/Lili/anaconda/lib/libz.dylib;/usr/lib/libdl.dylib;/usr/lib/libm.dylib (found version "1.8.16") -- Use absolute RPATH /usr/local/lib -- Downloading data file from crpropa.desy.de ~ 50 MB -- Extracting data file -- Found PythonInterp: /Users/Lili/anaconda/bin/python (found version "2.7.13") -- Found PythonLibs: /Users/Lili/anaconda/lib/libpython2.7.dylib (found version "2.7.13") -- Found SWIG: /usr/local/bin/swig (found version "3.0.8") -- Using user provided Python library: /Users/Lili/anaconda/lib/libpython2.7.dylib -- Python: Found! -- Version: 2.7/27 -- Executeable: /Users/Lili/anaconda/bin/python -- Include: /Users/Lili/anaconda/include/python2.7 -- Library: /Users/Lili/anaconda/lib/libpython2.7.dylib -- Site-package directory: /usr/local/lib/python2.7/site-packages -- Found numpy headers in /Users/Lili/anaconda/lib/python2.7/site-packages/numpy/core/include -- Configuring done -- Generating done -- Build files have been written to: /Users/Lili/Desktop/Google Drive/CRPropa3/build

rafaelab commented 7 years ago

Using the exact same compiler versions I cannot reproduce your problem.

This works for me, cleaning the build folder first:

cmake .. -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_FLAGS="-stdlib=libstdc++" -DENABLE_ROOT=False 

make -j 2 && make install

make test

ROOT is also working for me (same version as you have), but compiling CRPropa without it for the time being helps with the troubleshooting.

lyang54 commented 7 years ago

Now the make and make install finished, with make test there are some errors.

The following tests FAILED: 1 - testCore (OTHER_FAULT) 2 - testVector3 (OTHER_FAULT) 3 - testModuleList (OTHER_FAULT) 4 - testMagneticField (OTHER_FAULT) 5 - testDINT (OTHER_FAULT) 6 - testPropagation (OTHER_FAULT) 7 - testBreakCondition (OTHER_FAULT) 8 - testInteraction (OTHER_FAULT) 9 - testSource (OTHER_FAULT) 10 - testOutput (OTHER_FAULT) 11 - testFunctionalGroups (OTHER_FAULT) 12 - testGalacticMagneticLens (OTHER_FAULT) 13 - testMagneticLensPythonInterface (Failed) 14 - testSimulationExecution (Failed) 15 - testDiffusionSDE (Failed) 16 - testPythonExtension (Failed) 17 - testXML1D_discreteSource (OTHER_FAULT) 18 - testXML1D (OTHER_FAULT) 19 - testXML3D_continuousHomogeneousSources (OTHER_FAULT) 20 - testXML3D_discreteHomogeneousSources (OTHER_FAULT) 21 - testXML3D_noBfield (OTHER_FAULT) 22 - testXML3D_uniformBfield (OTHER_FAULT) 23 - testXMLCRPropa2EventOutput1D (OTHER_FAULT) 24 - testXMLCRPropa2EventOutput3D (OTHER_FAULT) 25 - testXMLCRPropa2TrajectoryOutput1D (OTHER_FAULT) 26 - testXMLCRPropa2TrajectoryOutput3D (OTHER_FAULT) Errors while running CTest make: *** [test] Error 8

import crpropa Traceback (most recent call last): File "", line 1, in File "crpropa.py", line 28, in _crpropa = swig_import_helper() File "crpropa.py", line 24, in swig_import_helper _mod = imp.load_module('_crpropa', fp, pathname, description) ImportError: dlopen(./_crpropa.so, 2): Library not loaded: libhdf5.10.dylib Referenced from: /Users/Lili/Desktop/Google Drive/CRPropa3/build/_crpropa.so Reason: image not found

rafaelab commented 7 years ago

Usually when make and make install work, make test also works (at least some of the tests). Did make and make install work?

From the second part of this message there seems to be a problem with HDF5, which can be disabled when running cmake: -DENABLE_HDF5=False.

lyang54 commented 7 years ago

Hi, thanks for your help. Now it looks working okay with some remaining issues. However, I can import crpropa with python. Thanks.

Test project /Users/Lili/Desktop/Google Drive/CRPropa3/build Start 1: testCore 1/26 Test #1: testCore ................................. Passed 0.08 sec Start 2: testVector3 2/26 Test #2: testVector3 .............................. Passed 0.03 sec Start 3: testModuleList 3/26 Test #3: testModuleList ........................... Passed 0.03 sec Start 4: testMagneticField 4/26 Test #4: testMagneticField ........................ Passed 0.03 sec Start 5: testDINT 5/26 Test #5: testDINT ................................. Passed 0.05 sec Start 6: testPropagation 6/26 Test #6: testPropagation .......................... Passed 0.04 sec Start 7: testBreakCondition 7/26 Test #7: testBreakCondition ....................... Passed 0.03 sec Start 8: testInteraction 8/26 Test #8: testInteraction .......................... Passed 69.57 sec Start 9: testSource 9/26 Test #9: testSource ............................... Passed 0.17 sec Start 10: testOutput 10/26 Test #10: testOutput ............................... Passed 0.04 sec Start 11: testFunctionalGroups 11/26 Test #11: testFunctionalGroups .....................***Failed 0.04 sec Start 12: testGalacticMagneticLens 12/26 Test #12: testGalacticMagneticLens ................. Passed 0.17 sec Start 13: testMagneticLensPythonInterface 13/26 Test #13: testMagneticLensPythonInterface .......... Passed 6.40 sec Start 14: testSimulationExecution 14/26 Test #14: testSimulationExecution .................. Passed 11.05 sec Start 15: testDiffusionSDE 15/26 Test #15: testDiffusionSDE ......................... Passed 3.52 sec Start 16: testPythonExtension 16/26 Test #16: testPythonExtension ...................... Passed 0.18 sec Start 17: testXML1D_discreteSource 17/26 Test #17: testXML1D_discreteSource ................. Passed 0.03 sec Start 18: testXML1D 18/26 Test #18: testXML1D ................................ Passed 0.34 sec Start 19: testXML3D_continuousHomogeneousSources 19/26 Test #19: testXML3D_continuousHomogeneousSources ... Passed 9.77 sec Start 20: testXML3D_discreteHomogeneousSources 20/26 Test #20: testXML3D_discreteHomogeneousSources ..... Passed 9.53 sec Start 21: testXML3D_noBfield 21/26 Test #21: testXML3D_noBfield ....................... Passed 0.10 sec Start 22: testXML3D_uniformBfield 22/26 Test #22: testXML3D_uniformBfield .................. Passed 3.64 sec Start 23: testXMLCRPropa2EventOutput1D 23/26 Test #23: testXMLCRPropa2EventOutput1D ............. Passed 0.03 sec Start 24: testXMLCRPropa2EventOutput3D 24/26 Test #24: testXMLCRPropa2EventOutput3D ............. Passed 0.03 sec Start 25: testXMLCRPropa2TrajectoryOutput1D 25/26 Test #25: testXMLCRPropa2TrajectoryOutput1D ........ Passed 0.03 sec Start 26: testXMLCRPropa2TrajectoryOutput3D 26/26 Test #26: testXMLCRPropa2TrajectoryOutput3D ........ Passed 0.03 sec

96% tests passed, 1 tests failed out of 26

Total Test time (real) = 115.00 sec

The following tests FAILED: 11 - testFunctionalGroups (Failed) Errors while running CTest make: *** [test] Error 8

adundovi commented 7 years ago

Hi @lyang54. Could you please run test testFunctionalGroups manually? In your build directory run: ./testFunctionalGroups and c/p the result here. Tnx.

lyang54 commented 7 years ago

That's interesting, it passed now...

Running main() from gtest_main.cc [==========] Running 1 test from 1 test case. [----------] Global test environment set-up. [----------] 1 test from testFunctionalGroups [ RUN ] testFunctionalGroups.gyroradius [ OK ] testFunctionalGroups.gyroradius (0 ms) [----------] 1 test from testFunctionalGroups (0 ms total)

[----------] Global test environment tear-down [==========] 1 test from 1 test case ran. (1 ms total) [ PASSED ] 1 test.

adundovi commented 7 years ago

OK, probably I should relax the margin of the result comparison in that test. Can this issue be closed now?

lyang54 commented 7 years ago

Yes, thanks.