We are working on setting up a Julia environment at the French IN2P3 computing center.
Note: These resources are available to HEP physicists from French institutes with an account at the center.
What is available now:
Julia v1.7.0. To enable it, use the command module add julia. (A more recent version can be installed on-demand)
Note 1: to prevent the error when adding a package, set the environment variable JULIA_DEPOT_PATH to $HOME/.julia:/pbs/software/centos-7-x86_64/julia/1.7.0/share .
Installing wrapit and use it to interface Julia with ROOT
This topic will be used for technical discussion on this effort and any other topic of interest for the Julia IN2P3/Irfu community. The goal of the CCIN2P3 team is to provide us with the best possible environment for our needs.
Patrice Lebrun (IN2P3, COMET), Wilfrid Da Silva (IN2P3, COMET), Sébastien Gadrat (IN2P3, CMS/CC-INP3) and Philippe Gras (Irfu, CMS and CUPID)
About testing WrapIt, I have installed Clang (together with LLVM v15.0.5, Clang being a sub-project of LLVM), compiled with gcc 9.3.1 (so fully compatible with C++17).
Environment setup can be done using module, as follow:
$ module load Libraries/llvm/15.0.5
I did not try to compile code yet, so it may be necessary to add some PATH to properly find all the required includes. I will do some tests and update the modulefile (to set up the environment) as required.
As you are several people interested in that software, I see no reason to not have it installed and available centrally. I can have a look and install it in the software area, and make a modulefile so it can be used using modules.
About ROOT, which version of it are you using? Is it a ROOT version installed here? I think only the latest ROOT version installed here, i.e. 6.26.10 is C++17 compliant (but the Clang version is not that new, i.e. 9.0.1 if I remember correctly).
I just took 3 seconds to follow the procedure but I got the following errors.
I suppose, I did not have the correct compiler.
cmake -DClang_DIR=/pbs/software/centos-7-x86_64/llvm/15.0.5/lib/cmake/clang …
– The C compiler identification is GNU 4.8.5
– The CXX compiler identification is GNU 4.8.5
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working C compiler: /usr/bin/gcc - skipped
– Detecting C compile features
– Detecting C compile features - done
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Check for working CXX compiler: /usr/bin/c++ - skipped
– Detecting CXX compile features
– Detecting CXX compile features - done
– Performing Test Terminfo_LINKABLE
– Performing Test Terminfo_LINKABLE - Success
– Found Terminfo: /usr/lib64/libtinfo.so
– Found ZLIB: /usr/lib64/libz.so (found version “1.2.7”)
– Found LibXml2: /usr/lib64/libxml2.so (found version “2.9.1”)
– Configuring done
CMake Error in CMakeLists.txt:
Target “wrapit” requires the language dialect “CXX17” (with compiler
extensions). But the current compiler “GNU” does not support this, or
CMake does not know the flags to enable it.
The command module add Libraries/llvm/15.0.5 should switch the compiler to 9.3.1. It is possible that cmake kept in cache the compiler it found in a previous run. Try to delete your build directory and start from a new one.
The problem I mentioned before turns out to be linked to the LLVM version. Would it be possible to install CLANG+LLVM version 11.0.1, for which the code has been validated? That’s great we can install wrapit. Let’s do it, once I’ve validated the problem is solved.
For my previous test I have deleted the build directory. To be sure after deleting build again I redo this test and I got the same error (no surprise).
Here is an output of printenv. I suppose some directories are not in the right place in PATH
cmake -DClang_DIR=/pbs/software/centos-7-x86_64/llvm/15.0.5/lib/cmake/clang -DCMAKE_CXX_COMPILER=which g++ -DCMAKE_C_COMPILER=which gcc …
– Configuring done
You have changed variables that require your cache to be deleted.
Configure will be re-run and you may have to reset some variables.
The following variables have changed:
CMAKE_C_COMPILER= /opt/rh/devtoolset-9/root/usr/bin/gcc
CMAKE_CXX_COMPILER= /opt/rh/devtoolset-9/root/usr/bin/g++
CMAKE_CXX_COMPILER= /opt/rh/devtoolset-9/root/usr/bin/g++
– The C compiler identification is GNU 9.3.1
– The CXX compiler identification is GNU 9.3.1
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working C compiler: /opt/rh/devtoolset-9/root/usr/bin/gcc - skipped
– Detecting C compile features
– Detecting C compile features - done
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Check for working CXX compiler: /opt/rh/devtoolset-9/root/usr/bin/g++ - skipped
– Detecting CXX compile features
– Detecting CXX compile features - done
– Performing Test Terminfo_LINKABLE
– Performing Test Terminfo_LINKABLE - Success
– Found Terminfo: /usr/lib64/libtinfo.so
– Found ZLIB: /usr/lib64/libz.so (found version “1.2.7”)
– Found LibXml2: /usr/lib64/libxml2.so (found version “2.9.1”)
– Configuring done
– Generating done
– Build files have been written to: /pbs/home/l/lebrun/comet/wrapit/build
More informations about gcc:
(without -DCMAKE_CXX_COMPILER=which g++` -DCMAKE_C_COMPILER= ``which gcc ` cmake does not work)
make
.
.
.
[ 14%] Linking CXX executable wrapit
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: CMakeFiles/wrapit.dir/src/libclang-ext.cpp.o: in function hasDefaultConstructor(CXCursor)': libclang-ext.cpp:(.text+0x32): undefined reference to typeinfo for clang::CXXRecordDecl’
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: libclang-ext.cpp:(.text+0x37): undefined reference to typeinfo for clang::Decl' /opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: CMakeFiles/wrapit.dir/src/libclang-ext.cpp.o: in function fully_qualified_name(CXCursor)‘:
libclang-ext.cpp:(.text+0xbb): undefined reference to typeinfo for clang::NamedDecl' /opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: libclang-ext.cpp:(.text+0xc0): undefined reference to typeinfo for clang::Decl’
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: CMakeFiles/wrapit.dir/src/libclang-ext.cpp.o: in function get_template_parameters(CXCursor)': libclang-ext.cpp:(.text+0xef8): undefined reference to typeinfo for clang::TemplateDecl’
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: libclang-ext.cpp:(.text+0xefd): undefined reference to `typeinfo for clang::Decl’
collect2: error: ld returned 1 exit status
make[2]: *** [wrapit] Error 1
make[1]: *** [CMakeFiles/wrapit.dir/all] Error 2
make: *** [all] Error 2