Maybe I didn't make it clear. What I want is to have mpicc and mpirun command to compile MPI written code, it is kind like a compiler(But only script point to gcc). Even added the BuildRequires of openmpi and openmpi-devel , the mpicc and mpirun command is not ready. Usually , people need to use mpi-selector or 'module load modulefile' to set the environment variable to enable the PATH and INCLUDE_PATH etc. to let it work. But mpi-selector cannot have effect on current shell , and 'module load ' neither, but in the obs environment , I cannot control the shell of packaging. The only way I do this now based on my knowledge is to manually extract information from like openmpi's module file and export PATH=... and export WHATEVER=... but this is the adhoc way and I think I should not parse the module file by myself. Below is an example of module file, it indicate the PATH, INCLUDE, LD_LIBRARY_PATH necessary to run 'mpicc' and 'mpirun'. A package installation won't set them automatically, so I need some way to setup it in the spec file %prep or %build stage. $ cat /usr/share/modules/gnu-openmpi/1.6 #%Module proc ModulesHelp { } { global dotversion puts stderr "\tLoads the gnu - openmpi 1.6 Environment" } module-whatis "Loads the gnu openmpi 1.6 Environment." conflict gnu-openmpi prepend-path PATH /usr/lib64/mpi/gcc/openmpi/bin prepend-path INCLUDE /usr/lib64/mpi/gcc/openmpi/include prepend-path INCLUDE /usr/lib64/mpi/gcc/openmpi/lib64 prepend-path MANPATH /usr/lib64/mpi/gcc/openmpi/share/man prepend-path LD_LIBRARY_PATH /usr/lib64/mpi/gcc/openmpi/lib64 2014-03-20 3:29 GMT-05:00 Ruediger Meier <sweet_f_a@gmx.de>:
On Thursday 20 March 2014, Pengfei Hao wrote:
I am packaging a package whcih need mpi environment, but default installation of OpenMPI will set nothing. So I don't have mpicc, mpirun .. etc. commands. I could export PATH= .... but I think this adhoc solution is not right.
Could anyone told me how to the standard way to set mpi as dependency?
You could do like in package devel:libraries:c_c++:hdf5
%if 0%{?sles_version} %define _mvapich2 1 %endif %if 0%{?suse_version} %define _openmpi 1 %endif
%define _mpi %{?_openmpi:openmpi} %{?_mvapich2:mvapich2}
...
%if 0%{?_openmpi} BuildRequires: openmpi-devel %endif %if 0%{?_mvapich2} BuildRequires: mvapich2-devel %endif
cu, Rudi -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
-- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org