Skip to content

Update SOFA and SofaPython3 to v24.12 #42

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

RafaelPalomar
Copy link
Contributor

This needs to be tested on the Slicer build environment before merge

This is a workaround for a compilation error on the centos-qt5-gcc7 environment
@RafaelPalomar
Copy link
Contributor Author

The following error has been found in the process of building SlicerSOFA within the centos-qt5-gcc7 environment

[ 97%] Linking CXX shared library ../../../../../../../../lib/python3/site-packages/Sofa/Types.cpython-39-x86_64-linux-gnu.so
/tmp/ccMjR6d7.ltrans2.ltrans.o: In function `sofa::linearalgebra::CompressedRowSparseMatrixConstraint<sofa::defaulttype::RigidDeriv<3u, double>, sofa::linearalgebra::CRSConstraintPolicy>::Name()':
<artificial>:(.text+0x5cd2): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /tmp/ccMjR6d7.ltrans2.ltrans.o: relocation R_X86_64_PC32 against undefined symbol `_ZNSsD1Ev' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
gmake[5]: *** [lib/python3/site-packages/Sofa/Types.cpython-39-x86_64-linux-gnu.so] Error 1
gmake[4]: *** [external_directories/SofaPython3/bindings/Sofa/src/SofaPython3/Sofa/Types/CMakeFiles/Bindings.Sofa.Types.dir/all] Error 2
gmake[3]: *** [all] Error 2
gmake[2]: *** [Sofa-prefix/src/Sofa-stamp/Sofa-build] Error 2
gmake[1]: *** [CMakeFiles/Sofa.dir/all] Error 2
gmake: *** [all] Error 2

Setting SOFA_ENABLE_LINK_TIME_OPTIMIZATION to ON can workaround this issue. @jcfr, @bakpaul my feeling is that this is related to the version of the compiler used being a little old for the code. My suggestion would be to proceed with this flag enabled for Linux and re-evaluate when the new Slicer infrastructure is in place.

@RafaelPalomar RafaelPalomar marked this pull request as ready for review February 5, 2025 09:05
@RafaelPalomar
Copy link
Contributor Author

RafaelPalomar commented Feb 5, 2025

This needs to be tested on the Slicer build environment before merge

DONE on centos-qt5-gcc7 build environment. Ready for review

@jcfr
Copy link
Member

jcfr commented Mar 4, 2025

Turns out that the SOFA build-system already take care of checking if the option is supported. See https://github.com/sofa-framework/sofa/blob/8e5f0b9e34821aaa49880eac20c051d895311f7a/Sofa/framework/Config/CMakeLists.txt#L120-L139

So enabling the option and adding a comment mentioning that:

  • the SOFA build-system will ignore the option if not supported will be sufficient.
  • the rational for enabling it (link to this issue)

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

Successfully merging this pull request may close these issues.

2 participants