Re: [ccp4bb] problems about installation of mosflm701

2008-03-27 Thread harry powell

Hi

First off, you really shouldn't be installing mosflm version 7.0.1 -  
version 7.0.3 is the current one, and contains numerous bug fixes.  
The developers are likely to meet any problem queries relating to  
7.0.1 with update to the current version first, then try again; if  
the problem persists, we will look at it...


Your immediate problem is that you are trying to run a csh script as  
a bash script, without editing the file properly; e.g., you can't  
just change setenv (csh) to export (bash) - the syntax is not the  
same - you'd need to change it thus -


setenv CCP4_LIB_FILES '-lccp4f -lccp4c -lxdl_view'

would become something like

export CCP4_LIB_FILES='-lccp4f -lccp4c -lxdl_view'

You would also need to change the top line of the file so that it was  
something like #!/bin/bash -f, though I would be more inclined to  
use a proper traditional Bourne shell for this and use #!/bin/sh -f  
and use sets and exports throughout.


If you really want to run the script, I would use tcsh or csh, rather  
than trying to modify it so that it is a bash script.


BTW, the Intel compiler setup in that file is way out of date - you'd  
need to change that as well to point to current copies of the compilers.


I would be very strongly inclined to install the mosflm_linux_suse  
pre-built executable - it should certainly work on FC5, and saves you  
the trouble of trying to build it. The speedup by using an executable  
compiled with the Intel compiler is probably not that great - recent  
g77s and gfortrans give excellent and stable optimization!


On 27 Mar 2008, at 04:57, Lu Yongzhi wrote:



- Original Message -
From: Lu Yongzhi
To: ccp4 bb
Sent: Wednesday, March 26, 2008 7:41 PM
Subject: problems about installation of mosflm701

Hi,

My OS is fedoral core 5. I have installed ccp4-6.0.2 which include  
the mosflm 6, but I want to install mosflm7.0.1. I downloaded the  
program, but I can't install it properly. I source the file  
'intel', the echo is (I have changed the 'setenv' to 'export'):



bash: export: `-lccp4f -lccp4c -lxdl_view': not a valid identifier
MOSROOT has been set to

bash: export: `/index': not a valid identifier
bash: export: `/src/dps/util': not a valid identifier
bash: export: `/jpg': not a valid identifier
bash: intel: line 65: syntax error: unexpected end of file

could anyone can help me.

the lines in the 'intel' file are:

#!/bin/csh -fv
#
# setup shell script for the development copies of Mosflm for  
different

# platforms.
#
# Common stuff first
#
export CCP4_LIB_FILES '-lccp4f -lccp4c -lxdl_view'
set mosroot = ${cwd:h}
export MOSROOT $mosroot
echo MOSROOT has been set to $MOSROOT
set moshome = ${cwd}
export MOSHOME $moshome
echo $MOSHOME
export AR_FLAGS vru
export DPS ${MOSHOME}
export IND ${MOSHOME}/index
export UTIL${MOSHOME}/src/dps/util
export JPG ${MOSHOME}/jpg
# intel compiler specifics - change this to your local installation
if ( -e /opt/intel/compiler70/ia32/bin/ifcvars.csh )then
source /opt/intel/compiler70/ia32/bin/ifcvars.csh
else
echo You must either edit the file called \intel\ to source  
the correct
echo ifcvars.csh file or install both the Intel C++ and FORTRAN  
compilers

exit
endif
if ( -e /opt/intel/compiler70/ia32/ifc_fudge.o )then
export FUDGE /opt/intel/compiler70/ia32/ifc_fudge.o
export NOFUDGE 
else
export FUDGE 
export NOFUDGE -i_dynamic
endif
export DEBUG 
export F77   ifc ${DEBUG}
export FCOMP   ${F77}
export FC  ${F77}
export CC icc ${DEBUG}
export FLINK   ${F77} ${DEBUG}
export FFLAGS  -O -align -w90 -cm
export CFLAGS   -O0 -O -DPROTOTYPE -DIFC  -c -w
# if no fudge.o vide infra export LFLAGS-Vaxlib -i_dynamic
export LFLAGS-Vaxlib $NOFUDGE
#
# (2) Mosflm directory
#
export MOSFLAGS  -O3 -align -w90 -cm
# export MOSFLAGS  -O3 -align -w90 -cm -prof_gen this line for  
profiling only
# export MOSFLAGS  -O3 -align -w90 -cm -prof_use  change $F77  
etc to include -ipo flag


export MCFLAGS   -O0
export MOSLIBS -L${CCP4_LIB} ${CCP4_LIB_FILES} -lncurses -L/ 
usr/X11R6/lib -lXt -lSM -lICE -lX11 -ldl -lpthread -lm ${FUDGE}

#
# (3) CBF directories
#
export CBFCFLAGS   -O -DPROTOTYPE -DIFC
# DPS
export VERBOSE v
export UTILFLAGS   -O -DPROTOTYPE -DIFC  -c -w
export EXTRAFLAGS  -I${UTIL} 
export STDCFLAGS   

exit



Harry
--
Dr Harry Powell, MRC Laboratory of Molecular Biology, MRC Centre,  
Hills Road, Cambridge, CB2 2QH







Re: [ccp4bb] problems about installation of mosflm701

2008-03-27 Thread Ian Tickle
 You would also need to change the top line of the file so 
 that it was something like #!/bin/bash -f, though I would 
 be more inclined to use a proper traditional Bourne shell for 
 this and use #!/bin/sh -f and use sets and exports throughout.

That's not actually necessary for a 'sourced' script because 'source'
reads it as a text file, not as an executable script, i.e. all you are
doing is temporarily switching input for the *current* shell from the
terminal to the file and back again.  So the first line, whatever it is,
if it begins with '#' it will be treated as a comment (that's why the
'#' is put there!).  In contrast, *running* a shell script starts a
*new* (child) shell (which need not be the same shell as the parent
shell).  If you start it like so: 'shell script_name' the shell
specified on the command line is used and any shell specification inside
the script is ignored; whereas if you start it like so: 'script_name'
(in which case it must be made executable first otherwise you will get
'permission denied'), then the shell specified by the first line
'#!shell' is used (if the first line is not in this format it uses
/bin/sh and the line is treated as a normal shell command).  For a
script which is intended to set up the environment for other programs
(e.g. CCP4) it's essential to source the file so that the commands in
the file modify the environment of the current shell from which you will
launch the programs.  If you run it in a child shell the environment set
up for the child process is *not* passed back to the parent shell, so it
will have absolutely no effect.

I often see people *running* programs (i.e. not just setting up the
environment) by sourcing a script, i.e. the script contains commands for
running programs: I always think that's a dangerous thing to do because
anything in the file which changes the environment will change the
environment for the terminal shell you are using, with unpredictable
consequences for things you type in later.  If I do that accidentally I
always immediately terminate the terminal shell and start a new one so
that the shell is in a known state, just to be on the safe side.  It's
always safer to *run* programs with a shell script using 'shell
script_name' or 'script_name' so then the script is completely isolated
from the terminal shell.
 
 If you really want to run the script, I would use tcsh or 
 csh, rather than trying to modify it so that it is a bash script.

That's all very well but people use other shells for their terminal
sessions for other reasons (e.g. csh/tcsh isn't guaranteed to be
portable, or the user may already have setup scripts for their current
shell which they don't want to rewrite).  As indicated above the
commands used in a 'sourced' script must correspond to the terminal
shell, since it is that environment you want to modify: any shell
specification inside the script is ignored, e.g. if you want to use bash
for your terminal shell (many people do!) then the sourced file *must*
contain bash commands, there's no way around it (this is why CCP4
supplies versions of the setup script for both sh and csh).

Cheers

-- Ian


Disclaimer
This communication is confidential and may contain privileged information 
intended solely for the named addressee(s). It may not be used or disclosed 
except for the purpose for which it has been sent. If you are not the intended 
recipient you must not review, use, disclose, copy, distribute or take any 
action in reliance upon it. If you have received this communication in error, 
please notify Astex Therapeutics Ltd by emailing [EMAIL PROTECTED] and destroy 
all copies of the message and any attached documents. 
Astex Therapeutics Ltd monitors, controls and protects all its messaging 
traffic in compliance with its corporate email policy. The Company accepts no 
liability or responsibility for any onward transmission or use of emails and 
attachments having left the Astex Therapeutics domain.  Unless expressly 
stated, opinions in this message are those of the individual sender and not of 
Astex Therapeutics Ltd. The recipient should check this email and any 
attachments for the presence of computer viruses. Astex Therapeutics Ltd 
accepts no liability for damage caused by any virus transmitted by this email. 
E-mail is susceptible to data corruption, interception, unauthorized amendment, 
and tampering, Astex Therapeutics Ltd only send and receive e-mails on the 
basis that the Company is not liable for any such alteration or any 
consequences thereof.
Astex Therapeutics Ltd., Registered in England at 436 Cambridge Science Park, 
Cambridge CB4 0QA under number 3751674


[ccp4bb] problems about installation of mosflm701

2008-03-26 Thread Lu Yongzhi

- Original Message - 
From: Lu Yongzhi 
To: ccp4 bb 
Sent: Wednesday, March 26, 2008 7:41 PM
Subject: problems about installation of mosflm701 


Hi, 

My OS is fedoral core 5. I have installed ccp4-6.0.2 which include the mosflm 
6, but I want to install mosflm7.0.1. I downloaded the program, but I can't 
install it properly. I source the file 'intel', the echo is (I have changed the 
'setenv' to 'export'):


bash: export: `-lccp4f -lccp4c -lxdl_view': not a valid identifier
MOSROOT has been set to

bash: export: `/index': not a valid identifier
bash: export: `/src/dps/util': not a valid identifier
bash: export: `/jpg': not a valid identifier
bash: intel: line 65: syntax error: unexpected end of file

could anyone can help me. 

the lines in the 'intel' file are:

#!/bin/csh -fv
#
# setup shell script for the development copies of Mosflm for different 
# platforms.
#
# Common stuff first
#
export CCP4_LIB_FILES '-lccp4f -lccp4c -lxdl_view'
set mosroot = ${cwd:h}
export MOSROOT $mosroot
echo MOSROOT has been set to $MOSROOT 
set moshome = ${cwd}
export MOSHOME $moshome
echo $MOSHOME
export AR_FLAGS vru
export DPS ${MOSHOME}
export IND ${MOSHOME}/index
export UTIL${MOSHOME}/src/dps/util
export JPG ${MOSHOME}/jpg
# intel compiler specifics - change this to your local installation
if ( -e /opt/intel/compiler70/ia32/bin/ifcvars.csh )then
source /opt/intel/compiler70/ia32/bin/ifcvars.csh
else
echo You must either edit the file called \intel\ to source the correct
echo ifcvars.csh file or install both the Intel C++ and FORTRAN compilers 
exit
endif
if ( -e /opt/intel/compiler70/ia32/ifc_fudge.o )then
export FUDGE /opt/intel/compiler70/ia32/ifc_fudge.o
export NOFUDGE 
else
export FUDGE 
export NOFUDGE -i_dynamic
endif
export DEBUG 
export F77   ifc ${DEBUG}
export FCOMP   ${F77}
export FC  ${F77}
export CC icc ${DEBUG}
export FLINK   ${F77} ${DEBUG} 
export FFLAGS  -O -align -w90 -cm
export CFLAGS   -O0 -O -DPROTOTYPE -DIFC  -c -w
# if no fudge.o vide infra export LFLAGS-Vaxlib -i_dynamic
export LFLAGS-Vaxlib $NOFUDGE
#
# (2) Mosflm directory
#
export MOSFLAGS  -O3 -align -w90 -cm
# export MOSFLAGS  -O3 -align -w90 -cm -prof_gen this line for profiling only
# export MOSFLAGS  -O3 -align -w90 -cm -prof_use  change $F77 etc to include 
-ipo flag

export MCFLAGS   -O0
export MOSLIBS -L${CCP4_LIB} ${CCP4_LIB_FILES} -lncurses -L/usr/X11R6/lib 
-lXt -lSM -lICE -lX11 -ldl -lpthread -lm ${FUDGE}
#
# (3) CBF directories
#
export CBFCFLAGS   -O -DPROTOTYPE -DIFC
# DPS
export VERBOSE v
export UTILFLAGS   -O -DPROTOTYPE -DIFC  -c -w
export EXTRAFLAGS  -I${UTIL} 
export STDCFLAGS   

exit