LinuxQuestions.org
Review your favorite Linux distribution.
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 12-14-2011, 03:53 PM   #1
beihaghian
LQ Newbie
 
Registered: Dec 2011
Posts: 9

Rep: Reputation: Disabled
bash: syntax error near unexpected token `newline'


hello all
I'm installing Intel® Fortran Composer XE for Linux* (formerly Intel® Fortran Compiler Professional Edition for Linux*)and i want to Getting Started with it.but when i set the compiler environment scrip there is an error
code:
source <install-dir>/opt/intel/bin/compilervars.sh <arg>

error:
bash: syntax error near unexpected token `newline'

please help me
thanks
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 12-14-2011, 04:15 PM   #2
andywebsdale
Member
 
Registered: Jan 2005
Location: Lewisham,London,UK
Distribution: Debian Wheezy AMD64
Posts: 87
Blog Entries: 2

Rep: Reputation: 23
What are you literally typing? not the <install-dir> & <arg> - they're meant to be replaced with your values. My guess is the code is:
Quote:
source /opt/intel/bin/compilervars.sh
followed by any arguments that the compilervars.sh script expects - no doubt they are described in the docs.
I hope this isn't too obvious & I haven't totally misunderstood your question
 
2 members found this post helpful.
Old 12-14-2011, 04:27 PM   #3
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Good shot, Andy! In addition, the name of the script is not actually compilervars.sh but the word compiler must be changed into the actual compiler used, ifort or icc. Regarding the argument, it specifies the processor architecture and the related instruction set. It can be any of ia32, intel64 or ia64. Indeed, the official documentation should reveal it all.
 
1 members found this post helpful.
Old 12-15-2011, 01:38 AM   #4
beihaghian
LQ Newbie
 
Registered: Dec 2011
Posts: 9

Original Poster
Rep: Reputation: Disabled
'bash: syntax error near unexpected token `newline''

thanks for your help...
and i have another question:
I install intel fortran compiler compilitly but when i type ifort in terminal an error happens ,it tells me comand not found.
Thanks for your attention
 
Old 12-15-2011, 02:23 AM   #5
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Quote:
Originally Posted by beihaghian View Post
I install intel fortran compiler compilitly but when i type ifort in terminal an error happens ,it tells me comand not found.
It means that you've not correctly sourced the aforementioned ifortvars.sh file. In order to do it at each login, you can either put the source command line in your $HOME/.bashrc (user based) or in a script with extension .sh in /etc/profile.d (system based). Example:
Code:
$ su -
Password:
# cd /etc/profile.d
# cat > ifort.sh
source /opt/intel/Compiler/11.1/074/bin/ifortvars.sh ia32
<Ctrl-D>
#
Ctrl-D here is used to terminate the standard input. The parts in grey must be customized according to the real installation path and the CPU architecture. If in doubt, please post the output of the following commands so we can check and tell it for sure:
Code:
find /opt -name ifortvars.sh
uname -a
grep -E "model name|flags" /proc/cpuinfo
Hope this helps.
 
1 members found this post helpful.
Old 12-15-2011, 09:33 AM   #6
beihaghian
LQ Newbie
 
Registered: Dec 2011
Posts: 9

Original Poster
Rep: Reputation: Disabled
finally i can do ifort correctly.
thanks for your help
 
  


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
syntax error near unexpected token 'newline' yusvian Linux - Newbie 6 11-23-2011 06:56 PM
[SOLVED] Syntax erroronear unexpected token `newline' noeleo Linux - Software 3 11-11-2011 04:40 PM
syntax error near unexpected token `newline' rcmonroig Linux - Software 2 07-22-2011 12:43 AM
syntax error near unexpected token `newline' uhollins Linux - Newbie 6 12-04-2008 01:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:44 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