Closed DegCo closed 1 year ago
Hi @DegCo,
Try cleaning up the build folder and then:
cmake .. [your options] -DCMAKE_CXX_FLAGS='-mcpu=apple-m1'
This works for me (Apple M1 + Clang).
Hi @rafaelab,
Thank you very much, with that the installation went through.
Really useful!
Unfortunately, the installing part (make install) is now the issue. After having arrived to 76%, it shows again a clang error:
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
Has it ever happened to you?
Thanks again! That was a huge improvement already :)
Error during make install
is completely new to me, except when there are permission issues (which is not the case).
After the first problem , did you try running cmake
after completely cleaning up the build/
folder? Sometimes some stuff remains and affects subsequent compilations.
I think so. More specifically, following the instructions + your suggestion, I used
$ export LLVM_DIR="/opt/homebrew/Cellar/llvm/16.0.6"
$ PYTHON_DIR=/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11
$ LLVM_VERSION=16.0.6
$ PYTHON_VERSION=3.11
$ cmake .. -DCMAKE_CXX_FLAGS='-mcpu=apple-m1' -DCMAKE_INSTALL_PREFIX=$CRPROPA_DIR \ -DPYTHON_EXECUTABLE=$PYTHON_DIR/bin/python$PYTHON_VERSION \ -DPYTHON_LIBRARY=$PYTHON_DIR/lib/libpython$PYTHON_VERSION.dylib \ -DPYTHON_INCLUDE_PATH=$PYTHON_DIR/include/python$PYTHON_VERSION \ -DCMAKE_C_COMPILER=$LLVM_DIR/bin/clang \ -DCMAKE_CXX_COMPILER=$LLVM_DIR/bin/clang++ \ -DOpenMP_CXX_FLAGS="-fopenmp -I$LLVM_DIR/lib/clang/$LLVM_VERSION/include" \ -DOpenMP_C_FLAGS="-fopenmp =libomp -I$LLVM_DIR/lib/clang/$LLVM_VERSION/include" \ -DOpenMP_libomp_LIBRARY=$LLVM_DIR/lib/libomp.dylib \ -DCMAKE_SHARED_LINKER_FLAGS="-L$LLVM_DIR/lib -lomp -Wl,-rpath,$LLVM_DIR/lib" \ -DOpenMP_C_LIB_NAMES=libomp \ -DOpenMP_CXX_LIB_NAMES=libomp \ -DNO_TCMALLOC=TRUE
The full error I get is:
[ 74%] Building CXX object CMakeFiles/crpropa.dir/src/magneticLens/ParticleMapsContainer.cpp.o clang-16: warning: argument unused during compilation: '-mcpu=apple-m1' [-Wunused-command-line-argument]
[ 74%] Linking CXX shared library libcrpropa.dylib ld: library not found for -lgfortran clang-16: 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
I have a -lgfortran
installed. Could it be that some extra path must be specified?
Thanks!
Apparently your system is not finding libgfortran
, which is a prerequisite for CRPropa.
If this is the case, it is not a CRPropa-related error.
The solution would probably be to look for libgfortran.dylib
(or libgfortran.a
) and add its folder to LD_LIBRARY_PATH
.
In my case (OSX, with homebrew), I found it with the command:
sudo find /opt -iname 'libgfortran.dylib' | xargs shasum
Maybe yours isn't in opt/
but somewhere else.
Thank you very much for the comment. After playing a bit around, I found out that some packages were interfering and now the installation goes through well, up to some warnings.
My last concern regards the make test
part. I attach here the LogFile.
LastTest.log
The majority of them seems to fail. The main element in common for them is the error message C++ exception with description "basic_string" thrown in the test body.
. I have asked around, but it seems that it is not a well documented error.
Furthermore, python crashes every time I run at the end of the make test
command. Have you got any ideas?
I am very sorry about the large number of problems, but I hope they will be useful also to others!
What happens when you run python -c "from crpropa import *"
?
Some tests are known to be failing in OSX, especially those related to galactic lenses.
But if you can run everything else and you don't require this feature, it should be fine.
After playing around, I gave up and used the virtual environment of Python.
Now it can be installed, but three tests fail: "testCore", "testInteraction", "testMagneticLensPythonInterface".
The examples in the tutorial seem to work. I will try to use the code as it is and keep an eye on possible errors.
Thanks a lot!
Dear developers,
I have problems installing CRPropa on my system:
Did you install CRPropa from git or download a release? I installed version 3.2 from from the releases.
Things that I tried before asking for help: I read and followed the installation instructions at https://crpropa.github.io/CRPropa3/ . Before writing this request I also checked previous installation issues at https://github.com/CRPropa/CRPropa3/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3Ainstallation+ . However, this did not work. I receive the following output:
is not able to compile a simple test program.
It fails with the following output:
CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:10 (project)
I have tried to use the newest version of llvm, 16.0.6 and the older one 15.0.7 (the output above), but the result does not change. I have followed the instructions for the Mac in the installing section.
CMakeCache.txt
Do you know how this issue could be solved? I have been trying to fix it for quite a while now without much success.
Thank you very much for your time!! :)