[mesa-users] stupid compiler question
Brian Mulligan
bwmulligan at astro.as.utexas.edu
Fri Jun 5 15:04:55 EDT 2015
Hi Amber,
It is possible to do if you use environment modules (
http://modules.sourceforge.net/). The modules package is installed on
many linux systems by default. It takes a little time to get everything
set up, you'll just need to ensure to install the ifort and gnu compiler
packages in a place other than /usr/bin, etc. /opt/local is a good
place for these sorts of things (though you will probably need root
access to install there. Make sure to create separate directories for
each compiler and package in /opt/local/.
I've not specifically done this for ifort/gfortran, but I have for
different versions of the gnu compilers. I have regularly seen both
ifort and gfortran installed on supercomputers, however; every one has
used some form of modules to switch between them.
As Josiah notes, you will need to have different mesa paths / setups.
You can also use modules to enforce that the mesa version and selected
compiler are compatable.
I've attached two sample module files for switching between gcc 4.4.7
and 4.9.0
-Brian
On 06/02/15 22:54, Josiah Schwab wrote:
> Hi Amber,
>
>> I am pretty sure I already know the answer to this; no. Is there any reason
>> one can't have both ifortran and gfortran installed? Do they play nice?
> Nope, I have ifort, my linux distro's gfortran, and the MESA SDK all
> installed next to each other.
>
> Building/running MESA requires having your paths/makefiles set up for
> the compiler you want to use, so if you want to regularly swap the
> compiler you're using with MESA, you'll have to manage that. (Which
> probably means having a separate MESA directory for each compiler.)
>
> Josiah
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> mesa-users mailing list
> mesa-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mesa-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20150605/7732156a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 4.4.7
Type: application/x-troff-man
Size: 1502 bytes
Desc: not available
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20150605/7732156a/attachment.man>
-------------- next part --------------
#%Module1.0#####################################################################
proc ModulesHelp { } {
GCC Compilers 4.9.0
This module loads GCC Compiler variables.
The command directory is added to PATH.
The library directory is added to LD_LIBRARY_PATH.
The include directory is added to INCLUDE.
The man directory is added to MANPATH.
}
#useful defines so that you don't have to retype all of these below
set version "4.9.0"
set GCChome /opt/ts3/gcc/gcc-4.9.0
set COMMONLIB /opt/ts3/gcc/common
#make sure that gcc 4.4.7 isn't loaded
conflict gcc/4.4.7
# info for the user if they do 'module whatis X'
module-whatis "Name: GCC Compilers"
module-whatis "Version: 4.9.0"
module-whatis "Category: compiler"
module-whatis "Keywords: System, compiler"
module-whatis "URL: http://gcc.gnu.org"
# changes to various paths for relevant compiler files
prepend-path PATH $GCChome/bin
prepend-path LD_LIBRARY_PATH $COMMONLIB/lib
prepend-path LD_LIBRARY_PATH $GCChome/lib64
prepend-path LD_RUN_PATH $COMMONLIB/lib
prepend-path LD_RUN_PATH $GCChome/lib64
prepend-path LIBRARY_PATH $COMMONLIB/lib
prepend-path LIBRARY_PATH $GCChome/lib64
prepend-path MANPATH $GCChome/share/man
prepend-path INFOPATH $GCChome/share/info
prepend-path C_INCLUDE_PATH $COMMONLIB/include
prepend-path CPLUS_INCLUDE_PATH $COMMONLIB/include
setenv GCC_LIB $GCChome/lib64
#module use -append $GCChome/modulefiles
#family("compiler")
More information about the Mesa-users
mailing list