Giter VIP home page Giter VIP logo

Comments (5)

bforsbe avatar bforsbe commented on August 22, 2024

Original comment by Jon Diprose (Bitbucket: well-jon, GitHub: Unknown):


Ah. From cmake's wiki: "Any other way (like writing make CC=gcc-3.3 CXX=g++-3.3) will not work". Every day is an education...

from relion.

bforsbe avatar bforsbe commented on August 22, 2024

Original comment by Jon Diprose (Bitbucket: well-jon, GitHub: Unknown):


Understood - it was more that I always forget cmake doesn't do what I expect and adding it to the docs might save others a few minutes googling. As building c++11 code (or, in this case, getting avx instructions out of fftw) requires a non-standard compiler on EL6-based distros, I'm regularly using a non-standard compiler.

For this build I'm using a local build of gcc4.9.3 installed to a non-standard (but visible cluster-wide) location. We use the environment-modules package to set up the correct environment for that build. I also use the scl-provided devtoolset-1.1 (gcc4.7.2, /opt/centos/devtoolset-1.1/root/usr/bin/gcc) and devtoolset-2 (gcc4.8.2, /opt/rh/devtoolset-2/root/usr/bin/gcc) versions. It's just easier for me to set my environment up right outside the build script and use `which gcc` inside the script.

from relion.

bforsbe avatar bforsbe commented on August 22, 2024

Original comment by Stefan Fleischmann (Bitbucket: sfle, GitHub: Unknown):


Hi Jon,

regarding "eating backticks", just put command lines and program output in between code tags:

$ cmake -DCMAKE_C_COMPILER=`which gcc` -DCMAKE_CXX_COMPILER=`which g++`

What is the output of "which gcc" on your system? I'm guessing it is /usr/bin/gcc which is in turn a link to something like gcc-5 or gcc-4.8.
In that case specifying the real name of the binary works just fine:

$ CC=gcc-4.8 CXX=g++-4.8 cmake .. -DGUI=OFF
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /usr/bin/gcc-4.8
-- Check for working C compiler: /usr/bin/gcc-4.8 -- works
...

vs.

$ CC=gcc-5 CXX=g++-5 cmake .. -DGUI=OFF
-- The C compiler identification is GNU 5.3.1
-- The CXX compiler identification is GNU 5.3.1
-- Check for working C compiler: /usr/bin/gcc-5
-- Check for working C compiler: /usr/bin/gcc-5 -- works
...

from relion.

bforsbe avatar bforsbe commented on August 22, 2024

Original comment by Bjoern Forsberg (Bitbucket: bforsbe, GitHub: bforsbe):


That's strange. I just tried on my system and it appears to work for me;

#!bash

$ gcc --version
gcc (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ cmake ..
-- The C compiler identification is GNU 5.2.1
-- The CXX compiler identification is GNU 5.2.1
{...}
$ export CC=gcc-4.8 CXX=g++-4.8 OMPI_CC=gcc-4.8 OMPI_CXX=g++-4.8
$ cmake ..
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /usr/bin/gcc-4.8
-- Check for working C compiler: /usr/bin/gcc-4.8 -- works

What system are you on?

from relion.

bforsbe avatar bforsbe commented on August 22, 2024

Original comment by Jon Diprose (Bitbucket: well-jon, GitHub: Unknown):


OK, how do you make this not eat backticks? `? No. `? Oh, it's markdown, so with a backslash. The above should show:

cmake -DCMAKE_C_COMPILER=`which gcc` -DCMAKE_CXX_COMPILER=`which g++` ...

So I actually do:

/apps/well/cmake/2.8.12.2/bin/cmake -DCMAKE_C_COMPILER=`which gcc` -DCMAKE_CXX_COMPILER=`which g++` -DFORCE_OWN_FFTW=ON -DFORCE_OWN_FLTK=ON ../

from relion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.