no mpicxx when compiling examples for NVIDIA CUDA 5 - cuda

I installed the driver and toolkit for CUDA 5 in 64-bit RHEL 6.3 successfully.
However, when I tried compiling the CUDA 5 examples, I got the error message:
make[1]: Leaving directory `/root/NVIDIA_CUDA-5.0_Samples/0_Simple/cppIntegration'
which: no mpicxx
How can I fix this for the CUDA 5 examples to compile?

In order to build the simpleMPI example, you need some kind of MPI installed on your system. You can get around this and build most of the samples by doing:
make -k
this will attempt to go past errors in the make process and build all targets that can be built.
If you prefer, you can delete this directory:
/root/NVIDIA_CUDA-5.0_Samples/0_Simple/simpleMPI
perhaps with the following command, as root:
rm -Rf /root/NVIDIA_CUDA-5.0_Samples/0_Simple/simpleMPI
and relaunch your make. Personally I think the make -k option is simpler.
(the message about cppIntegration is just the last target that got successfully built)

Related

How to specify include directory of mpicxx in the command line option of make?

I am trying to build all CUDA samples by running make in the sample's base folder. One of the samples require mpi.h, but the system did not have it, which causes an error:
make[1]: Entering directory '$HOME/cuda_samples/samples/0_Simple/simpleMPI'
/bin/mpicxx -I../../common/inc -o simpleMPI_mpi.o -c simpleMPI.cpp
simpleMPI.cpp:25:10: fatal error: mpi.h: No such file or directory
25 | #include <mpi.h>
| ^~~~~~~
compilation terminated.
make[1]: *** [Makefile:371: simpleMPI_mpi.o] Error 1
Since I don't have root privilege, I downloaded a deb file for libopenmpi-dev package (using apt-get download command) and extracted it to somewhere in my user space (using dpkg -x command). However, as we can see, mpicxx tries to find mpi.h in ../../common/inc, which is not where I installed libopenmpi-dev in my user space (I did not notice that untill I installed the package. My bad). So I need to somehow tell mpicxx to find mpi.h in another directory. I know there is a -I option to tell make where additional include directories are, but this option does not apply to mpicxx. How to pass directory information from make's command line to mpicxx is beyond my knowledge. Can you please teach me what option I should use in make's command line to specify include directory used by mpicxx? Of course I can manually copy the installed libopenmpi-dev package to ../../common/inc to accommodate original settings in CUDA sample, but I would like to do something cool and learn something new, so I ask here. Thank you in advance for teaching me.
Environment:
Remote Linux with core version 5.8.0. I am not a super user.
CUDA version: 11.2
CPU: Intel Core i9-10900K
gcc version: (Ubuntu 10.2.0-13ubuntu1) 10.2.0
make version: GNU Make 4.3, Built for x86_64-pc-linux-gnu
MPI version: 4.0.3
The include directory in Makefile is held in a variable INCLUDES, together with -I. So, if we can somehow transfer the include directory of mpi installed in my user space to this variable, we are done. So, the question is reduced to how to transfer a user-defined value from make's command line into Makefile's variable and override it if it has be defined, as is clearly asked in the question.
Fortunately make provides this command line option: VAR=value, so the option to answer my question is
make INCLUDES=-I/path/to/mpi/include/in/my/user/space

Perl to mysql connectivity on Windows 10

I have a process that works in the production environment, that I need to get working on my local Windows 10 environment. It is a Perl script that calls mySql stored procedures.
I have installed ActivePerl 5.26.3 (64-Bit) from Active State. When I attempt to execute the script I get an error:
Can't locate DBD/mysql.pm (you may need to install the DBD::mysql module)...
So, I went to https://metacpan.org/release/DBD-mysql and found instructions that indicated I needed to do the following:
perl -MCPAN -e shell
install DBD::mysql
But, when I type the first command I get a message stating:
It looks like you don't have a C compiler and make utility installed. Trying to install dmake and the MinGW gcc compiler using the Perl Package Manager. This may take several minutes....
Then it goes thru what appears to be a successful installation. So I type in the second command. It scrolls by for a while, but ends with:
Failed during this command
DVEEDEN/DBD-mysql-4.050.tar.gz: writemakefile NO 'C:\Perl64\bin\perl.exe MakeFile.PL INSTALLDIRS=site' returned status 512
Not sure how to proceed.
For ActivePerl, use their package manager PPM.
Or, use Strawberry Perl for a more unixy experience. It comes with all the stuff to compile and install modules.
No matter which Perl you use, on Windows or elsewhere, modules typically need to be compiled the same. Mixing compilers (such as Visual Studio and gcc) or options can lead to incompatible binaries. The same might happen across Perl versions too. That means to use the same Perl (and compilation method) for everything in your project).
The cpan utility doesn't figure out those things for you. It does whatever it's configured to do.
For what it's worth, the cpan method to install modules can be simpler:
$ cpan DBD::mysql

CUDA 8 examples on Ubuntu 16 not finding libGLU, libGL, or libX11

I am using CUDA 8 and I am able to run some of the examples but I can not get any of the visualizations to run. I have gotten them to work in the past, but now I am not able to reproduce the results on the same computer with a fresh install. Mint or Ubuntu.
after a successful install of CUDA I try to make the particles or nbody samples but I get this error:
>>> WARNING - libGL.so not found, refer to CUDA Getting Started Guide for how to find and install them. <<<
>>> WARNING - libGLU.so not found, refer to CUDA Getting Started Guide for how to find and install them. <<<
>>> WARNING - libX11.so not found, refer to CUDA Getting Started Guide for how to find and install them. <<<
I looked through the Getting Started guide but have not found a solution.
I am systematically working through the symbolic links. perhaps someone here can offer a suggestion...
The result of a find request...
$ sudo find / -name 'libGLU*'
/usr/lib/i386-linux-gnu/libGLU.so.1.3.1
/usr/lib/i386-linux-gnu/libGLU.so.1
/usr/lib/x86_64-linux-gnu/libGLU.a
/usr/lib/x86_64-linux-gnu/libGLU.so.1.3.1
/usr/lib/x86_64-linux-gnu/libGLU.so.1
/usr/lib/x86_64-linux-gnu/libGLU.so
I have been trying to create symbolic links to the i386* and x86* libraries but havnt gotten it to work yet.
I am, for example, trying
sudo ln -s /usr/lib/i386-linux-gnu/libGLU.so /usr/lib/libGLU.so
My question now is, which libGLU.so do I need to point "/usr/lib/libGLU.so" to?
.a ?
.1?
.1.3.1?
x86 or i386? I know my system is 64bit but is CUDA expecting a 32bit library?
Doesn't seem like it should or would but... ?
I have tried the solutions on every SO and other board I can find... the two most relevant are
Cuda 6.5 cannot find - libGLU. (On ubuntu 14.04 64 bit)
and
http://kislayabhi.github.io/Installing_CUDA_with_Ubuntu/
which is where this question has existed previously.
It appears that the answer is in the link provided by Robert Crovella.
sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev libglfw3-dev libgles2-mesa-dev
then
GLPATH=/usr/lib make
instead of just make
source of solution
Thank you Robert.

can't find any solution for running f2py correctly on my windows 7 machine

Can someone pinpoint where I'm doing wrong, PLEASE? I'm so exhausted. I installed MinGW 4.7, python2.7.8, numpy 1.7.1 and scipy0.13.2 to an Anaconda (32bit) environment in Windows7.
Also, for user enviroment variables, I set
C_INCLUDE_PATH:
D:\Anaconda2\envs\arc103\MinGW\i686-w64-mingw32\include
Path (User variable):
C:\Program Files (x86)\Microsoft VS code\bin;D:\Anaconda2\Library\bin;D:\Anaconda2\envs\arc103\MinGW\bin
Tying the following commands in Anaconda Prompt
"f2py -c --help-fcompiler" outputs "... Fortran compilers found:
--fcompiler=gnu95 GNU Fortran 95 compiler (4.7.0) ...."
"f2py -c --help-compiler" outputs
"List of available compilers: ...", not specifically compilers found though.
Running "f2py -c fib1.f -m fib1" according to "NumPy v1.12.dev0 Manual" gives me lots of error as below:
D:\Anaconda2\envs\arc103\Scripts\gfortran.bat -Wall -Wall -shared c:\users\dkim1\appdata\local\temp\tmpvyedhg\Release\users\dkim1\appdata\local\temp\tmpvyedhg\src.win32-.7\fib1module.oc:\users\dkim1\appdata\local\temp\tmpvyedhg\Release\users\dkim1\appdata\local\temp\tmpvyedhg\src.win32-2.7\fortranobject.o c:\users\dkim1\appdata\local\temp\tmpvyedhg\Release\fib1.o -Ld:\anaconda2\envs\arc103\mingw\lib\gcc\i686-w64-mingw32\4.7.0 -LD:\Anaconda2\envs\arc103\libs -LD:\Anaconda2\envs\arc103\PCbuild -lpython27 -lgfortran -o .\fib1.pyd
c:\users\dkim1\appdata\local\temp\tmpvyedhg\Release\users\dkim1\appdata\local\temp\tmpvyedhg\src.win32-2.7\fib1module.o:fib1module.c:(.text+0x35): undefined reference to `__imp__PyNumber_Int'
c:\users\dkim1\appdata\local\temp\tmpvyedhg\Release\users\dkim1\appdata\local\temp\tmpvyedhg\src.win32-2.7\fib1module.o:fib1module.c:(.text+0x68): undefined reference to `__imp__PyComplex_Type'
c:\users\dkim1\appdata\local\temp\tmpvyedhg\Release\users\dkim1\appdata\local\temp\tmpvyedhg\src.win32-2.7\fib1module.o:fib1module.c:(.text+0x79): undefined reference to `__imp__PyType_IsSubtype'
c:\users\dkim1\appdata\local\temp\tmpvyedhg\Release\users\dkim1\appdata\local\temp\tmpvyedhg\src.win32-2.7\fib1module.o:fib1module.c:(.text+0x93): undefined reference to `__imp__PyErr_Occurred'
... (Thousands of "undefined reference to" errors I didn't put it here) ...
collect2.exe: error: ld returned 1 exit statuserror: Command "D:\Anaconda2\envs\arc103\Scripts\gfortran.bat -Wall -Wall -shared c:\users\dkim1\appdata\local\temp\tmpvyedhg\Release\users\dkim1\appdata\local\temp\tmpvyedhg\src.win32-2.7\fib1module.o
c:\users\dkim1\appdata\local\temp\tmpvyedhg\Release\users\dkim1\appdata\local\temp\tmpvyedhg\src.win32-2.7\fortranobject.o
c:\users\dkim1\appdata\local\temp\tmpvyedhg\Release\fib1.o -Ld:\anaconda2\envs\arc103\mingw\lib\gcc\i686-w64-mingw32\4.7.0 -LD:\Anaconda2\envs\arc103\libs
-LD:\Anaconda2\envs\arc103\PCbuild -lpython27 -lgfortran -o .\fib1.pyd" failed with exit status 1
Sorry for the mess. I have spent almost a few months finding out the fix, but it's too hard for me and all gone to no avail. It would be hugely appreciated if you can help me out. Thanks.
Since this is a couple month old, I am not sure if these tips will still help, but I found when building a Fortran to Python module on Win 10, that only compiling for 32bit worked, and you need to use a signature file, i.e. something along the lines of:
f2py.py -c cuncsd.pyf cuncsd.f
Instead of using the i686-w64-mingw32 toolchain I used a straight mingw32 one (to reduce the risk that I accidentally end up with anything 64bit).
I also found that you need to install a special Visual Studio for Python instance as described here:
Microsoft Visual C++ Compiler for Python 3.4
If you are using Python 2.7 this VSC version should do the trick for you, only newer version (3.5, 3.6) are left out at this time.
For reference here is my complete f2py invocation on the console that I ended up using (neither python nor f2py were on the execution PATH):
python C:\Python34\Scripts\f2py.py -c cuncsd.pyf --opt="-frecursive -fmax-stack-var-size=66560" cuncsd.f -llapack -lrefblas -ltmglib
This particular module depends on 32 bit LAPCK shared libraries that I compiled previously, and we found it even works on XP systems.
I later went back and tried to compile this for 64 bit, but eventually gave up, when I always encountered ld errors. I think going forward for Windows 10 it will be much easier to use the embedded Ubuntu to execute and extend Python.
(See How to enable Bash in Windows 10 developer preview? and Getting PyCharm to recognize python on the windows linux subsystem (bash on windows))

Creating riak nodes: bitcask version clash

I have installed riak on a Fedora 17 system (but not using the package manager) by following the standard instructions, i.e.:
$ wget http://downloads.basho.com.s3-website-us-east-1.amazonaws.com/riak/1.2/1.2.1/riak-1.2.1.tar.gz
$ tar zxvf riak-1.2.1.tar.gz
$ cd riak-1.2.1
$ make all
This worked and I now tried to create four nodes as described in the Fast Track tutorial:
$ make devrel
This runs for a while and then produces the error below:
==> rel (generate)
ERROR: generate failed while processing /space/surechem/riak-1.2.1/rel: {'EXIT',{{badmatch,{error,"bitcask: Application version clash. Multiple directories contains version \"1.5.2\"."}},
[{rebar_reltool,generate,2,[]},
{rebar_core,run_modules,4,[]},
{rebar_core,execute,4,[]},
{rebar_core,process_dir,4,[]},
{rebar_core,process_commands,2,[]},
{rebar,main,1,[]},
{escript,run,2,[{file,"escript.erl"},{line,741}]},
{escript,start,1,[{file,"escript.erl"},{line,277}]}]}}
make: *** [dev1] Error 1
I have difficulties understanding what that error message is trying to tell me.
Is this a version conflict with bitcask? The Fedora package erlang-bitcask is installed on the machine (erlang-bitcask-1.5.2-1.fc17.x86_64). Should it be removed? Do I need a different version of it?
Indeed this seems to be caused by conflicts with Erlang packages installed in the system. After removing the erlang-bitcask package from the system, I got similar error messages for other packages. In the end I had to remove four packages,
$ sudo yum remove erlang-bitcask erlang-ebloom erlang-js erlang-luke
to get it to work.