Building parallel hdf5 with cygwin - parallel-processing

I recently attempted to install parallel hdf5-1.10.1 from source with cygwin 2.8.2 and stumbled into a "SIG_SETMASK undeclared" error during make. I wanted to use h5py to write hdf files in parallel (in windows environment).
I tried to follow the instructions from https://support.hdfgroup.org/ftp/HDF5/current/src/unpacked/release_docs/INSTALL_parallel
First I ran the c version of the Sample_mpio.c and it seems it worked:
Proc 2: all tests passed
Proc 3: all tests passed
Proc 1: all tests passed
Proc 0: all tests passed
So, the first step was configure:
CC=mpicc ./configure --enable-parallel --enable-shared
and then make
However, at some point make exited with several SIG_SETMASK undeclared error messages pointing to sigsetjmp(J,N) of the #define HDsigsetjmp(J,N) sigsetjmp(J,N) part followed by in expansion of macro ... for several macros.
Since there are no separate building instructions for cygwin, like for the serial case, I thought it might be an issue of cygwin.
What is the proper way to install parallel hdf5 (and h5py) on windows?
Edit 1:
Thanks to #varro 's suggestion, setting make CFLAGS=-D_POSIX_C_SOURCE resolved the error.
Nevertheless, now make check gives a segmentation fault...
Testing testhdf5.exe
/bin/sh: line 30: 22284 Segmentation fault (core dumped) srcdir="." ./${tname} >> ${log} 2>&1

Related

ScaLapack installation fails with its auto installer package on Centos7 but it succeeds on Centos 6.7. Why?

I am trying to install the ScaLAPACK with the help of Python-based installer available at http://www.netlib.org/scalapack/scalapack_installer.tgz on CentOS 7(64bit). It is installing successfully but failing in test routines step and showing the error. how to fix it?
The command used for the compilation is as follows:
./setup.py --prefix=/home/tools/scalapack --blaslib="-L/usr/lib64 -lblas" --lapacklib="-L/usr/lib64 -llapack -lblas" --mpiincdir=/opt/apps/mpich32/include --fcflags="-fbounds-check" --mpirun=mpirun --mpicc=mpicc --mpif90=mpif90
The process description is as follows
Installing scalapack-2.0.2 ...
Writing SLmake.inc... done.
Compiling BLACS, PBLAS and ScaLAPACK... done
Getting ScaLAPACK version number... 2.0.1
Installation of ScaLAPACK successful.
(log is in /home/tools/scalapack_installer/build/log/scalog )
Compiling test routines... done
Running BLACS test routines... done
Running PBLAS test routines...
PBLAS: error running PBLAS test routines xcpblas2tst
PBLAS: Command mpirun -np 4 ./xcpblas2tst
stderr:
****************************************
At line 1 of file ctzpad.f
Fortran runtime error: Actual string length is shorter than the declared one for dummy argument 'herm' (-960965440/1)

Installing Perl and PDL

I am currently trying - unsuccessfully to install perl PDL as I would like to automate some of my data analysis and graphics generation.
Unfortunately I seem unable to even install the necessary modules without issue, let alone create a small script to deal with my data files.
I have some rudementary experience with Perl but Nothing fancy and am using Windows 10 x64.
Initially I went for the x64 strawberry perl v5.24 installation, followed by ppm installations of Astro::FITS::Header, Convert::UU, OpenGL and PDL - as instructed here http://pdl.perl.org/?page=install. However, there were issues with the installation of Inline::C and after trying the example listed on page 5 of the PDL_Book_Latest http://sourceforge.net/projects/pdl/files/PDL/2.4.10/PDL-Book-20120205.pdf/download there wasn't any image appearing, nor image file in any location I could think to search. Back to Google and still no luck finding any information on the source of this issue so I decided to go back to square one and use an older version in the hopes that it would be more well documented.
So, uninstallation of strawberry perl through Windows installed programs dialog, deletion of strawberry folder and registry entries containing "strawberry". Then a new installation of perl, with the Padre IDE, v5.14 - maybe some debugging fonctionality will help pinpoint the errors. Started installing the same modules (Astro::FITS::Header, Convert::UU, OpenGL, PGPLOT). Astro and Convert worked fine, but the OpenGL started throwing errors about ExtUtils::F77 which I am apparently missing after a few more hours searching. I go to install this module and it keeps giving errors about 'gfortan' being an unknown command... It was my understanding that the idea of PDL was to avoid fortran and C, and I have found next to no information about this installation problem so far.
So i decided to try an alternative approach. I installed the ppm module from cpan and repeated the initial installation process through the ppm command. This time i get:
"Unknown element 'PROVIDE' found inside SOFTPKG. at C:/Dwimperl/perl/site/lib/PPM.pm line 1462."
So my question is as follows:
Am I missing some critical step in the installation process? Is my system just handing this really badly, and if so is there any sort of possible work around? Is the fact that I tried two different versions liable to create path issues that could be at the root of this problem?
Could anyone provide an alternative and preferably not too complex route to install PDL with a given perl installation on Windows 10?
EDIT 1:
Here is the code for the error I got trying to install Inline::C, an apparent pre-requisite for PDL
code deleted to make space for updates...
EDIT 3:
I reinstalled GnuWin32 in the directory specified by PATH, rather that changing PATH, and the tried the installation again. Inline::C gave the same 'diff' and 'rm' errors. So i ran "cpanm --notest 'package'" to install Inline::C and then PDL, both said they were successful. However, even using '--notest' cpanm could not install OpenGL and PGPLOT.
The final objectif is to be able to produce graphics using the fonctions from PGPLOT: for example
# use PDL;
# use PDL::Graphics::PGPLOT;
# imag(sin(rvals(200,200)+1));
yet this doesn't work of course if PGPLOT can't install.
EDIT 4:
Tried the fix found by #Dr.Avalange at sourceforge https://sourceforge.net/p/pogl/bugs/26/ and noticed that I seem to have multiple copies of this file.
Here
Is this normal...?
EDIT 5:
So i uninstalled perl, deleted any lingering files I could find in %APPDATA%, %USERPROFILE% and C:/DWIM, and then ran ccleaner just in case I missed anything.
I then downloaded Strawberry perl 5.24.1 x64 for Windows and installed it.
After this, I ran 'cpanm Astro::FITS::Header', cpanm 'Convert-UU' and 'cpanm OpenGL' as per http://pdl.perl.org/?page=install. This all worked fine. Then I ran 'cpanm PDL' which installed Inline, Pegex, Win32::Mutex and Module::Compile dependencies. However, if had the same error with Inline::C that you mentioned previously.
I already had GetGnuWin32 installed before so not sure why this isn't working. The Windows 'Path' environment (not PATH - this doesn't exist according to the advaced system dialogue) is noted as
%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;
In this directory I have the folder GetGnuWin32 which should have installed all the packages from the link you provided, unless there is a supplementary step that I missed to install this correctly? So I redownloaded the DiffUtils setup and ran that, installing to \programfiles(x86) (default option). I then reran 'cpanm PDL'.
I still get the same 'diff' error message. So is DiffUtils, not installing properly? (I did close and re-open the commandline between tries and after the installation)
EDIT 6:
So after installing PDL and PGPLOT with --notest I tried to run the following test and it failed. See below
C:\Windows\system32>perldl
perlDL shell v1.357
PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file
'COPYING' in the PDL distribution. This is free software and you
are welcome to redistribute it under certain conditions, see
the same file for details.
ReadLines, NiceSlice, MultiLines enabled
Reading PDL/default.pdl...
Found docs database C:/Strawberry/perl/site/lib/PDL/pdldoc.db
Type 'help' for online help
Type 'demo' for online demos
Loaded PDL v2.017 (supports bad values)
Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended)
pdl> use PDL::Graphics//PLplot
Unknown regexp modifier "/P" at (eval 62) line 4, at end of line
Unknown regexp modifier "/L" at (eval 62) line 4, at end of line
Unknown regexp modifier "/t" at (eval 62) line 4, at end of line
BEGIN not safe after errors--compilation aborted at (eval 62) line 5, <DATA> line 207.
pdl> use PDL::Graphics::PLplot
Can't locate PDL/Graphics/PLplot.pm in #INC (you may need to install the PDL::Graphics::PLplot module) (#INC contains: C:/Strawberry/perl/site/lib/MSWin32-x64-multi-thread C:/Strawberry/perl/site/lib C:/Strawberry/perl/vendor/lib C:/Strawberry/perl/lib .) at (eval 72) line 5.
BEGIN failed--compilation aborted
pdl> use PDL
pdl> use lib 'C:/Strawberry/perl/site/lib/PDL/Graphics'
pdl> use PGPLOT
pdl> use PDL::Graphics::PGPLOT
pdl> imag(sin(rvals(200,200)+1))
Undefined subroutine &PDL::Graphics::PGPLOT::pgqinf called at C:/Strawberry/perl/site/lib/PDL/Graphics/PGPLOT.pm line 408, <DATA> line 90.
pdl> exit
C:\Windows\system32>cpanm PDL::Graphics::PGPLOT::pgqinf
! Finding PDL::Graphics::PGPLOT::pgqinf on cpanmetadb failed.
! Finding PDL::Graphics::PGPLOT::pgqinf () on mirror http://www.cpan.org failed.
! Couldn't find module or a distribution PDL::Graphics::PGPLOT::pgqinf
C:\Windows\system32>cpan PDL::Graphics::PGPLOT::pgqinf
Loading internal null logger. Install Log::Log4perl for logging messages
CPAN: CPAN::SQLite loaded ok (v0.211)
Database was generated on Thu, 13 Apr 2017 13:49:14 GMT
C:\Windows\system32>
There was already a directory problem but I managed to point it in th right direction I had thought. Also tried installing the PLplot 'cpanm' said the installation was successful but there is no .pm file, only a .pd in another directory and so the use PDL::Graphics::PLplot fails as there is no .pm file to find.
EDIT: 7
So retrying ppm install http://www.sisyphusion.tk/ppm/PGPLOT.ppd seemed to work this time as the links int he explanation you provided are no longer in use
http://www.kalinabears.com.au/w32perl/pgplot-5.2.2-mingw32.tar.bz2
http://jrfonseca.home.dyndns.org/projects/gnu-win32/software/ported/patches/pgplot-5.2.2-mingw32.diff.gz
And while this seemed to work, there are no traces of the files that were listed as necessary for the installation, unless they were just for this specific method?
pgplot/bin/cpgplot.dll
pgplot/bin/pgplot.dll
pgplot/bin/grfont.dat
pgplot/include/cpgplot.h
pgplot/lib/cpgplot.a
pgplot/lib/pgplot.a
finally, trying the example again gives the following; no errors, but no image either...
Microsoft Windows [version 10.0.14393]
(c) 2016 Microsoft Corporation. Tous droits réservés.
C:\Windows\system32>perldl
perlDL shell v1.357
PDL comes with ABSOLUTELY NO WARRANTY. For details, see the file
'COPYING' in the PDL distribution. This is free software and you
are welcome to redistribute it under certain conditions, see
the same file for details.
ReadLines, NiceSlice, MultiLines enabled
Reading PDL/default.pdl...
Found docs database C:/Strawberry/perl/site/lib/PDL/pdldoc.db
Type 'help' for online help
Type 'demo' for online demos
Loaded PDL v2.017 (supports bad values)
Note: AutoLoader not enabled ('use PDL::AutoLoader' recommended)
pdl> use PDL
pdl> use PDL::Graphics::PGPLOT
pdl> imag(rvals(200,200)+1)
%PGPLOT, Unable to read font file: grfont.dat
%PGPLOT, Use environment variable PGPLOT_FONT to specify the location of the PGPLOT grfont.dat file.
Displaying 200 x 200 image from 1 to 142.421356201172, using 240 colors (16-255)...
pdl> $ENV{PGPLOT_FONT} = "C:/Strawberry/perl/site/lib/PGPLOT/pgplot_supp"
pdl> imag(rvals(200,200)+1)
Displaying 200 x 200 image from 1 to 142.421356201172, using 240 colors (16-255)...
pdl>
After translating from French I can see that you don't have diff in your system. Either install diff (part of gnu32: http://gnuwin32.sourceforge.net/) or just skip the tests. See also:
https://github.com/ingydotnet/inline-c-pm/issues/60
With Strawberry 5.24.1 simply type the following from the command prompt:
cpanm --notest PDL
or if you want to watch everything that's going on:
cpanm -v --notest PDL
This will take some time to run.

How to use mpi on Mac OS X

I have been searching for a way to use mpi on my mac but everything is very advanced.
I have successfully installed open-mpi using
brew install open-mpi
I have .c files ready for compiling and running. When I type:
mpicc -o <file> <file.c>
followed by
mpirun <file>
I get
[xxxxx-MacBook-Pro.local:13623] [[44919,0],0] ORTE_ERROR_LOG: Bad
parameter in file orted/pmix/pmix_server.c at line 262
[xxxxx-MacBook-Pro.local:13623] [[44919,0],0] ORTE_ERROR_LOG: Bad
parameter in file ess_hnp_module.c at line 666
It looks like orte_init failed for some reason; your parallel process
is likely to abort. There are many reasons that a parallel process
can fail during orte_init; some of which are due to configuration or
environment problems. This failure appears to be an internal failure;
here's some additional information (which may only be relevant to an
Open MPI developer):
pmix server init failed
--> Returned value Bad parameter (-5) instead of ORTE_SUCCESS
I also get the same message when I enter:
mpirun -np 2 <file>
What am I doing wrong?
If I were you, I'd do following:
Installation of Open MPI is fairly straightforward
https://www.open-mpi.org/software/ompi/v2.0/
> tar xf openmpi-2.0.2.tar
> cd openmpi-2.0.2/
> ./configure --prefix=$HOME/opt/usr/local
> make all
> make install
> $HOME/opt/usr/local/bin/mpirun --version
mpirun (Open MPI) 2.0.2
Report bugs to http://www.open-mpi.org/community/help/
You can use super simple hello world for testing purposes
#include <mpi.h>
#include <stdio.h>
int main(int argc, char** argv) {
MPI_Init(NULL, NULL);
int rank;
int world;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &world);
printf("Hello: rank %d, world: %d\n",rank, world);
MPI_Finalize();
}
After everything is in place, simply compile and run the code
$HOME/opt/usr/local/bin/mpicc -o hello ./hello.c
$HOME/opt/usr/local/bin/mpirun -np 2 ./hello
Hello: rank 0, world: 2
Hello: rank 1, world: 2
Works perfectly fine on macOS
Update
In case you are looking for MPI related environment on macOS, I suggest checking out concept of modules.
building MPICH/OpenMPI - https://www.owsiak.org/building-opencoarrays-on-macos-everything-from-the-sources-gcc-9-2-0/
modules - https://www.owsiak.org/modules-as-a-convenient-way-of-choosing-build-chain-on-macos/
Building on the answer provided by #Oo.oO.
Install OpenMPI.
It can be installed using brew.
brew install openmpi
On some versions of Mac OS X / MacOS Sierra, the default temporary directory location is sufficiently long that it is easy for an application to create file names for temporary files which exceed the maximum allowed file name length, Which can cause this error.
so you should set the temporary directory using export TMPDIR=/tmp
more details here https://www.open-mpi.org/faq/?category=osx
If you have anaconda installed, this is the fastest option for me:
conda install mpi4py openmpi
I have noticed that during execution pmix offers an unnecesary exception of the form:
PMIX ERROR: ERROR in file gds_ds12_lock_pthread.c at line 206
To prevent this, before the execution of main file always type this on the terminal prompt :
export PMIX_MCA_gds=hash
This helps subside the pmix noice and has to be repeated every session.
Note:
The maximum number of slots that pmi allows is by default 2 in macs. A "slot" is the Open MPI term for an allocatable unit where we can
launch a process. This determines how many time we can run an instruction in a code.
To extend the number of slots carry out the following steps:
1.Create a hostfile with anyname
2.within the write:
localhost slots = <#>
where #=no. of slots needed.
while compiling write the following on the terminal prompt:
mpicc -hostfile -<filename>
While running wite the following on the terminal prompt:
mpirun -hostfile -np <#>
Although be weary of the last note,it isnt often needed and the file extention of the hostfile may become a problem with certain architectures , such as my own x86.

FreeBSD make error File 5.19 supports only version 12 magic files. /usr/share/misc/magic.mgc is version 8

I'm having trouble reinstalling ProFTPD on a FreeBSD 10.1 setup. The server is newly upgraded from 10.0 to 10.1. When I start the make install clean process, these warnings first shows on screen.
===> proftpd-1.3.5_4 depends on shared library: libpcre.so
/usr/share/misc/magic, 93: Warning: Printf format `l' is not valid for type `lelong' in description `, %ld pages'
...
/usr/share/misc/magic, 15118: Warning: Printf format `l' is not valid for type `belong' in description `Volume %ld,'
/usr/share/misc/magic, 15609: Warning: Current entry does not yet have a description for adding a MIME type
file: File 5.19 supports only version 12 magic files. `/usr/share/misc/magic.mgc' is version 8
[: =: unexpected operator
- not found
And after i while, the make process stops with this error:
/bin/ln -s libpcre.so.1 /usr/ports/devel/pcre/work/stage/usr/local/lib/libpcre.so.3
====> Compressing man pages (compress-man)
===> Installing for pcre-8.35_2
===> Checking if pcre already installed
===> pcre-8.35_2 is already installed
You may wish to ``make deinstall'' and install this port again
by ``make reinstall'' to upgrade it properly.
If you really wish to overwrite the old port of pcre
without deleting it first, set the variable "FORCE_PKG_REGISTER"
in your environment or the "make install" command line.
*** Error code 1
Stop.
make[3]: stopped in /usr/ports/devel/pcre
*** Error code 1
Stop.
make[2]: stopped in /usr/ports/devel/pcre
*** Error code 1
Stop.
make[1]: stopped in /usr/ports/ftp/proftpd
*** Error code 1
Stop.
make: stopped in /usr/ports/ftp/proftpd
Seems that the file /usr/share/misc/magic.mgc is of a wrong version?
This might happens when I was upgrading from 10.0-RELEASE-p12 to 10.1-RELESE-p1?
If i run make install clean of the ProFTP port, and disable support for pcre, the process and install is successful.
But I believe that something is still broken?
My programming skills are limited, and also this level of error.
Please let me know if you have any ideas,
Thanks,
First of all, proftpd 1.3.5 is available as a binary package, it's much simpler to install it that way (pkg install proftpd).
Second - at first it looked like a port bug; as Etan said, there is a shell syntax error (something like '[ x == y ]' instead of '[ x = y ]'); those are common, and ports contain patches to fix those. However, there is a binary package, and packages are built from ports ("make package"), so port obviously does work on package build machines. So it's probably something specific to your environment.
If you really want to build from ports, try this: first, reinstall pcre. For some reason it had to be rebuilt, but failed to install, because it's already installed. So, "cd /usr/ports/*/pcre && make clean all deinstall reinstall". That should get rid of the second error. Then go back to "../*/proftpd" and see how far it goes.
But really, I'd try packages first. They have nothing in common with old pkg_add system, and are really nice.
freebsd-update diff for FreeBSD-SA-14:28.file seems wrong, and it breaks file(1).
Therefore simply pkg install file will be a workaround.

How to write llvm pass in Mac OS X 10.9

I built my pass on Linux and it worked there correctly. Now when I brought in my code to Mac OS X 10.9 on Mac Airbook, its not working anymore. I am describing below the steps I took for building my llvm pass.
My source tree is llvm-3.4 and llv-3.4/tools/clang-3.4
I ran ./configure --prefix=/some-path --enable-targets=host which was successful.
Then I ran make && make install which completed without any errors.
I exported the bin path export PATH=/some-path/bin:$path and checked for which clang which opt and they pointed to my installation.
Now when I tried to load hello pass opt -load /some-path/lib/LLVMHello.dylib -hello <fac.bc >/dev/null I get the following error
Error opening '/some-path/lib/LLVMHello.dylib': dlopen(/some-path/lib/LLVMHello.dylib, 9): Symbol not found: __ZN4llvm12FunctionPass17assignPassManagerERNS_7PMStackENS_15PassManagerTypeE
Referenced from: /some-path/lib/LLVMHello.dylib
Expected in: flat namespace
in /some-path/lib/LLVMHello.dylib
-load request ignored.
opt: Unknown command line argument '-hello'. Try: '/some-path/bin/opt -help'
opt: Did you mean '-help'?
Can someone help me fix this issue or at least point in the right direction.
In my case, the dynamic LLVM library, which is required for dynamically loaded passes, was missing. I solved it by configuring LLVM with --enable-shared. I also had --enable-keep-symbols set, but I don't think this is necessary. The full configure command I used:
./configure --enable-shared --enable-keep-symbols
I know I'm a bit late with the answer, but I recently ran into the same problem. And since I spent quite some time solving the issue, I wanted to pass on my findings. Hope it helps.
Cheers, Marcus

Resources