LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-20-2009, 01:41 AM   #1
Kilam orez
Member
 
Registered: Aug 2009
Location: India
Distribution: open suse, fedora
Posts: 33

Rep: Reputation: 15
Unhappy how to compile a software package with a specific compiler


hi dear all

i want to compile a software package(which comes as tar file,i untar it and then compile ) with compiler of my own chioce.

how can i do this? i have two compilers-gfortran and ifort.
when i compile a package it automatically compiles with ifort, but i want to compile with gfortran.

thanks in advance

kilam
 
Old 10-20-2009, 01:59 AM   #2
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 210Reputation: 210Reputation: 210
(1) Change the makefile.

If there is a line,

FC=ifort

change it to FC=gfortran

(2) otherwise, try invoking make as:

FC=gfortran make

OR

export FC=gfortran
make

Last edited by jhwilliams; 10-20-2009 at 02:01 AM.
 
Old 10-20-2009, 04:02 AM   #3
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by Kilam orez View Post
hi dear all

i want to compile a software package(which comes as tar file,i untar it and then compile ) with compiler of my own chioce.

how can i do this? i have two compilers-gfortran and ifort.
when i compile a package it automatically compiles with ifort, but i want to compile with gfortran.

thanks in advance

kilam
Something like:

Code:
$ make CC=gfortran
Although specifying a particular fortran compiler may require a different variable name. Another approach is to read the makefile and see how it specifies the compiler.

Yet another approach is not to use make, but invoke the compiler directly:

Code:
$ gfortran (source file names)
The above won't work for complex software projects.
 
Old 10-20-2009, 07:40 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,634

Rep: Reputation: 3268Reputation: 3268Reputation: 3268Reputation: 3268Reputation: 3268Reputation: 3268Reputation: 3268Reputation: 3268Reputation: 3268Reputation: 3268Reputation: 3268
./configure FC=gfortran
and / or
make FC=gfortran
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to Compile Software Package. C compiler cannot create executables * Error Msg* Ciik13 Programming 6 09-24-2009 11:38 PM
Compiler questions (g++ specific) zensunni Programming 4 03-10-2008 10:06 AM
How to specify a specific compiler version? raid517 Linux - Software 7 06-18-2006 09:33 AM
compile software by tar package kernelvn *BSD 2 06-12-2005 12:17 PM


All times are GMT -5. The time now is 09:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration