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

Steps for compiling COBS on server with old GCC/C++/C compiler #16

Open
shenwei356 opened this issue Dec 31, 2020 · 0 comments
Open

Steps for compiling COBS on server with old GCC/C++/C compiler #16

shenwei356 opened this issue Dec 31, 2020 · 0 comments

Comments

@shenwei356
Copy link

I spent two hours finguring out how to compile cobs on our server (CentOS 7.9 with gcc 4.8.5) using conda. May this helps.

  1. Create conda env and install new gcc/cc/c++ compilers

     # conda env remove -n cobs
    
     conda create -n cobs cmake
    
     conda activate cobs
    
     # mamba is faster for installing packages
     conda install -y mamba
     
     mamba install -c conda-forge -y gcc_impl_linux-64 c-compiler cxx-compiler zlib
    
  2. Link binaries and some libs

     # gcc binary
     cd /home/shenwei/app/miniconda3/envs/cobs/bin; 
     ln -s ../libexec/gcc/x86_64-conda-linux-gnu/9.3.0/gcc
     
     # cobs uses old boost version which relies on libboost_**-mt.a
     cd /home/shenwei/app/miniconda3/envs/cobs/lib
     ln -s libboost_system.a libboost_system-mt.a
     ln -s libboost_filesystem.a libboost_filesystem-mt.a
    
  3. Edit envinronment, add few lines to ~/.bashrc.

     # vim ~/.bashrc
     export LD_LIBRARY_PATH=$app/miniconda3/envs/cobs/lib:$LD_LIBRARY_PATH
     export C_INCLUDE_PATH=$app/miniconda3/envs/cobs/include
     export CPLUS_INCLUDE_PATH=$app/miniconda3/envs/cobs/include
    
  4. Reactivate envonment

     conda deactivate
     
     conda activate cobs    
    
  5. Compile cobs

     git clone --recursive https://github.com/bingmann/cobs.git
     mkdir cobs/build
     cd cobs/build
     cmake ..
     make -j4
     
     # copy binary to somewhere in $PATH
     cp src/cobs ~/bin/
    
leoisl added a commit to leoisl/cobs that referenced this issue Jul 19, 2022
* Now forcing boost

* Now compiling with boost

* Linking boost statically

* Forcing boost

* boost

* Fixing a recursion error with tests

* Adding -DBOOST flag to force Boost

* Trying to build with clang

* Trying boost 1.72

* Boost 1.76

* -DBOOST=1

* Trying to install libomp on OS X

* Compiling without pthreads

* retry

* ls /usr/local/Cellar/libomp/14.0.6

* listing libomp files

* making clang find threads

* Fixing finding boost

* What???

* what

* Maybe was a $ in the path

* Debugging

* Maybe there is no need to find boost?

* resintalling libomp

* libomp

* Removing -fopenmp

* Adding fopenmp back and llvm

* Improving CMakeLists

* Improving warning messages

* Updating README

* Updating build.yaml

* Using static linking

* Making test a little bit more lenient

* Removing static linking

* Removing static linking

* Adding back other builds

* Finishing build.yaml
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

1 participant