McStas installation and questions

Kristian Nielsen kristian.nielsen at risoe.dk
Fri Jan 22 12:19:53 CET 1999


> As I already mentioned in a previous mail, I'm deseperatly trying to install 
> McStas program on my account. I'm not root on our machines, and it doesn't seems 
> to be so easy as written in the manual !

Sorry that I took so long to answer, but thinks have been a bit hectic
this week due to major restructuring of the department.

If security regulations etc. permits you to, you could supply me with an
account on the machines and I could log in myself and investigate
(assuming this is not impossible because of firewalls). Otherwise we
will have to use e-mail debugging; I will try to answer subsequent
emails quickly.

> 1a- First, I tryied to install the program on HP two HP stations. The first one 
> is a 
> hp9000s800 bi-processor machine. In that case, an error appears in 
> pre-processing when compiling ('make', after 'configure 
> --prefix=/home/tas/farhi'), as reported in the previous mail :

Using the prefix in this way to avoid needing root privileges should be fine.

>         gcc -I. -I. -c -O2 -DMC_SYS_DIR='"'/home/tas/farhi/lib/mcstas'"' 
> -DCC_HAS_PROTOS=1  -DDEBUG=0 instrument.tab.c
> as: "/var/tmp/cca11970.s", line 2786: error 1052: Directive name not recognized 
> - PARAM

Now this is a strange error, since it happens in the assembler! I am
really tempted to suggest a problem with the installation of the gcc
compiler on this machine. Is it possible to compile other C programs
with gcc on the HP? Perhaps there might be a problem if the gcc compiler
is using the HP assembler?

Anyway, you could try setting the environment variable CC before running
configure, one of these commands should work depending on your shell:

    setenv CC cc
    CC=cc ; export CC

This will only work if you bought the optional ANSI C compiler for the HP.

>         gcc -I. -I. -c -O2 -DMC_SYS_DIR='"'/home/tas/farhi/lib/mcstas'"' 
> -DCC_HAS_PROTOS=1  -DDEBUG=0 instrument.tab.c
> In file included from 
> /usr/local/lib/gcc-lib/hppa1.1-hp-hpux9.03/2.6.3/include/stdlib.h:231,
>                  from mcstas.h:59,
>                  from instrument.y:70:
> /usr/include/pwd.h:29: parse error before `int32_t'

This is also a bit strange since it happens in the system include
files. Again, I tend to suspect a problem with the compiler
installation.But try to add the following line at the top of the file
"mcstas.h":

#include <sys/types.h>

I have a hunch that might just work. If it does, tell me and I will try
to find a portable way to fix this problem. You might also try the CC
trick on this machine.

> 2- After those two uneffective trials, I turned to a SGI machine iris4d. 
> Compiling is nearly ok : configure+make, with warnings as follows :

Compilation seems to run fine.

> cannot load /opt/imake/bin/install (bu24):No such file or directory

This is suspicious, since it is trying to run /opt/imake/bin/install
which is the path returned by the configure run on the HP! The problem
is that "./configure" builds a cache file the first time it is run, and
subsequent runs do not actually configure but just read previous results
from the cache. Maybe you used the same network-mounted directory for
the HP and SGI compilations, or perhaps copied the directory from the HP
to the SGI instead of using a freshly unpacked distribution? In this
case try again on the SGI either from a newly unpacked distribution, or
delete the cache file:

    rm config.cache

before "./configure" and "make install".

Anyway, it is not too difficult to do the install manually. While in the
main mcstas directory, execute the commands

  cp mcstas gscan mcdisplay /home/tas/farhi/bin/
  cp lib/* /home/tas/farhi/lib/mcstas/
  chmod +x /home/tas/farhi/bin/mcstas
  chmod +rx /home/tas/farhi/bin/gscan
  chmod +rx /home/tas/farhi/bin/mcdisplay
  chmod +r /home/tas/farhi/lib/mcstas/*

Replace /home/tas/farhi with the relevant directory if necessary.

> beeing root or needing some 'hieroglyphic' commands ? Are there some already 
> compiled versions for HP or SGI ?

If the above does not work I have HP binaries that I could send you, and
I can produce SGI binaries as well. But hopefully I can fix McStas so
that later versions compile out of the box on your machines also.

> Ian Anderson is now discussing your coming in Marsh, but I'd like to play with 
> your toy before. I'd like also to indicate than a deeply improved version of 

Yes I think we should get McStas up and running at the ILL as much as
possible before the visit so that we can utilize the time in the best
possible way.

> MFit/Mview is now available on ILL/TAS group Web page (which becomes an official 
> archive site for those Matlab stuff: http://www.ill.fr/tas).
> 
> I now began to think about a graphic user interface between MFit/Mview and 
> McStas (if I can ever make this latter work !), that would enable to build 
> instruments easely, to pre-process mcstas, and compile gcc Monte Carlo program, 
> simulate scans and finally display results, all mouse-driven, if
> possible.

This sounds very exiting! I hope that you get started on this project,
and I will do my best to support with guidance, extensions to McStas,
etc.

I hope the above helps, please write back and tell me how it worked, and
I will promise a speedy reply.

 - Kristian.






More information about the mcstas-users mailing list