Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting up CLASS with classy libclass.a #613

Open
matthemattix opened this issue Feb 5, 2025 · 2 comments
Open

Setting up CLASS with classy libclass.a #613

matthemattix opened this issue Feb 5, 2025 · 2 comments

Comments

@matthemattix
Copy link

My end goal with CLASS is to modify it to test new physics. However, I seem to have an issue getting started. I have downloaded CLASS from github on Mac Sonoma 14.6.1. Have cleaned and compiled with no errors. However, when I go to the python directory and run setup.py to set up classy I get this:

g++ -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.8/Users/username/class_public-master/python/../python/classy.o -L/Users/username/class_public-master/python/.. -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/lib/darwin -lclass -o build/lib.macosx-10.9-x86_64-3.8/classy.cpython-38-darwin.so
ld: library 'class' not found
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'g++' failed with exit status 1

From what I can tell there should be a libclass.a or an libclass.so that is created in the build directory when CLASS compiles. All I have is an empty lib directory in the build directory and no libclass files.

Without this I can't use classy.

Is my approach wrong here? Do I have to alter something?

Thanks,
-Matt

@lesgourg
Copy link
Owner

lesgourg commented Feb 6, 2025

Dear Matt, it sounds like you only did 'make class'. This would only compile the C code - but not the library libclass, nor the wrapper classy. Instead, you are supposed to do 'make clean' and then just 'make' (or 'make -j' for a faster compilation). This will compile everything in a row: C code, library, and classy wrapper. You don't need to worry about setup.py ever, this will be run through the 'make' command. (Note: In a few days, we will release class v3.3.0, and there it will be even simpler: you'll just need to do 'make install .')

@matthemattix
Copy link
Author

Thanks! That fixed my issue.

-Matt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants