Mailing List picongpu-users@hzdr.de Message #53
From: Dr. Ajit Upadhyay <ajitup@rrcat.gov.in>
Subject: Re: [PIConGPU-Users] [PIConGPU-Users] [PIConGPU-Users] [PIConGPU-Users] PIConGPU compilation -lpthread error
Date: Thu, 28 Apr 2016 15:46:46 +0530
To: <picongpu-users@hzdr.de>
Dear Rene,

Yes, they seem to be independent problems.

I could not understand which CMakeLists.txt is to be edited and where
should I put those lines. I am not aware of cmake scripting. Is it the one
in /src/picongpu directory. I would be grateful if you could send me the
edited CMakeLists.txt


Here is the output of commands:

ajitup@plasma01:~> cmake --version
cmake version 3.5.1
CMake suite maintained and supported by Kitware (kitware.com/cmake).

ajitup@plasma01:~> cd ~/src/picongpu
ajitup@plasma01:~/src/picongpu> git status
On branch release-0.1.2
Your branch is up-to-date with 'origin/release-0.1.2'.
nothing to commit, working directory clean

ajitup@plasma01:~/src/picongpu> git checkout HEAD
Your branch is up-to-date with 'origin/release-0.1.2'.

ajitup@plasma01:~/src/picongpu> cd ~/build
ajitup@plasma01:~/build> rm -r ../build/*

ajitup@plasma01:~/build> echo $PICSRC
/home/ajitup/src/picongpu

ajitup@plasma01:~/build> ls ~/paramSets/case001
cmakeFlags  include  submit

ajitup@plasma01:~/build> $PICSRC/configure ~/paramSets/case001
cmake command: cmake -DCUDA_ARCH=sm_20
-DCMAKE_INSTALL_PREFIX=/home/ajitup/paramSets/case001
-DPIC_EXTENSION_PATH=/home/ajitup/paramSets/case001  
/home/ajitup/src/picongpu
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - found
-- Found Threads: TRUE
-- Found CUDA: /usr/local/cuda (found suitable version "7.0", minimum
required is "5.0")
-- Debug version
-- Found MPI_C: /usr/lib64/mpi/gcc/openmpi/lib64/libmpi.so
-- Found MPI_CXX:
/usr/lib64/mpi/gcc/openmpi/lib64/libmpi_cxx.so;/usr/lib64/mpi/gcc/openmpi/lib64/libmpi.so
-- Boost version: 1.54.0
-- Found the following Boost libraries:
--   program_options
--   regex
--   filesystem
--   system
CMake Error at CMakeLists.txt:38 (add_subdirectory):
  The binary directory

    /home/ajitup/build/build_picongpu

  is already used to build a source directory.  It cannot be used to build
  source directory

    /home/ajitup/src/picongpu/src/picongpu

  Specify a unique binary directory name.


CMake Error at CMakeLists.txt:38 (add_subdirectory):
  The binary directory

    /home/ajitup/build/build_picongpu

  is already used to build a source directory.  It cannot be used to build
  source directory

    /home/ajitup/src/picongpu/src/picongpu

  Specify a unique binary directory name.


-- Found 'adios_config': /home/ajitup/lib/adios/bin/adios_config
-- ADIOS linker flags (unparsed): -L/home/ajitup/lib/adios/lib -ladios -lm
-lmxml -lpthread -libverbs
-- Found adios in /home/ajitup/lib/adios/lib64/libadios.a
-- Found m in /usr/lib64/libm.so
-- Found mxml in /usr/lib64/libmxml.so
-- Found pthread in /usr/lib64/libpthread.so
-- Found ibverbs in /usr/lib64/libibverbs.so
-- Found ADIOS:
/home/ajitup/lib/adios/lib64/libadios.a;/usr/lib64/libm.so;/usr/lib64/libmxml.so;/usr/lib64/libpthread.so;/usr/lib64/libibverbs.so
(found suitable version "1.9.0", minimum required is "1.6.0")
-- Enable ADIOS data transforms
-- Found HDF5:
/usr/lib64/mpi/gcc/openmpi/lib64/libhdf5.so;/usr/lib64/libpthread.so;/usr/lib64/libz.so;/usr/lib64/libdl.so;/usr/lib64/libm.so
(found version "1.8.16")
-- libSplash supports PARALLEL output
-- Found Splash:
/home/ajitup/lib/splash/lib/libsplash.a;/usr/lib64/mpi/gcc/openmpi/lib64/libhdf5.so;/usr/lib64/libpthread.so;/usr/lib64/libz.so;/usr/lib64/libdl.so;/usr/lib64/libm.so;/usr/lib64/mpi/gcc/openmpi/lib64/libmpi.so;/usr/lib64/mpi/gcc/openmpi/lib64/libmpi_cxx.so;/usr/lib64/mpi/gcc/openmpi/lib64/libmpi.so
(found suitable version "1.3.0", minimum required is "1.2.4")
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.8")
-- Found PNG: /usr/lib64/libpng.so (found suitable version "1.6.8",
minimum required is "1.2.9")
-- Found Freetype: /usr/lib64/libfreetype.so (found version "2.5.5")
-- Found PNGwriter:
/home/ajitup/lib/pngwriter/lib/libpngwriter.so;/usr/lib64/libpng.so;/usr/lib64/libz.so;/usr/lib64/libfreetype.so
(found version "0.5.4")
-- Configuring incomplete, errors occurred!
See also "/home/ajitup/build/CMakeFiles/CMakeOutput.log".
See also "/home/ajitup/build/CMakeFiles/CMakeError.log".
ajitup@plasma01:~/build> make
make: *** No targets specified and no makefile found.  Stop.
ajitup@plasma01:~/build>



regards,
ajit



> ---------------------------- Original Message ----------------------------
> Subject: Re:  [PIConGPU-Users] [PIConGPU-Users] [PIConGPU-Users]
> [PIConGPU-Users] PIConGPU compilation -lpthread error
> From:    René Widera <r.widera@hzdr.de>
> Date:    Thu, April 28, 2016 2:46 pm
> To:      picongpu-users@hzdr.de
> --------------------------------------------------------------------------
>
> Dear Ajit,
>
> it looks like that both issues are independent.
>
> pthread issue:
> - the linker needs to know that you need libpthread.so
> - please add `-lpthread` to your linker command or add in CMakeLists.txt
> ```CMAKE
> find_package(Threads REQUIRED)
> set(LIBS ${LIBS} ${CMAKE_THREAD_LIBS_INIT})
> #...
> target_link_libraries(
>      PROJECTNAME
>      ${LIBS})
> ```
>
> picongpu issue:
>
> Your log shows this:
> ```
> CMake Error at CMakeLists.txt:38 (add_subdirectory):
>    The binary directory
>      /home/ajitup/build/build_picongpu
>    is already used to build a source directory.  It cannot be used to
> build
> source directory
>      /home/ajitup/code.PIConGPU/picongpu-master/src/picongpu
> ```
> - it looks like cmake asume that the source code of PICoNGPU is in
> `~/code.PIConGPU` and not in `$PICSRC` which points to `~/src/picongpu`
> - please run the following commands and send use the output
>    - `cmake --version`
>    - `cd ~/src/picongpu`
>    - `git status`
>    - `git checkout HEAD .`
>    - `cd ~/build`
>    - `rm -r ../build/*`
>    - `echo $PICSRC`
>    - `ls ~/paramSets/case001`
>    - `$PICSRC/configure ~/paramSets/case001`
>    - `make`
>
> best,
>
> René
>
> On 28.04.2016 06:10, Dr. Ajit Upadhyay wrote:
>> Dear Axel,
>>
>> I have been following your suggestion.
>> Every time, I use a script to build which has
>>
>> rm -fR ~/build
>> mkdir ~/build
>> cd ~/build
>> $PICSRC/configure ~/paramSets/case001
>>
>> So there is no question of any outdated build residing inside the build
>> directory.
>> As before every build attempt, the build directory is re-created.
>> It could be some other issue, which I am not able to find out.
>>
>> Also, could pthread_create error be due to cuda-7.5 and gcc-4.8 and
>> glibc?
>> Today, I will try with cuda-7.0 and same version of gcc and glibc and
>> let you know.
>>
>> Regards,
>> Ajit
>>
>>
>>
>> -----Original Message-----
>> From: picongpu-users@hzdr.de [mailto:picongpu-users@hzdr.de] On Behalf
>> Of Huebl, Axel
>> Sent: Wednesday, April 27, 2016 8:43 PM
>> To: picongpu-users@hzdr.de
>> Subject: Re: [PIConGPU-Users] [PIConGPU-Users] PIConGPU compilation
>> -lpthread error
>>
>> Dear Ajit,
>>
>> looks like an older, outdated build using CMake resides inside build/
>> Just remove it like this:
>>
>> cd $HOME/build
>> rm -rf ../build/*
>>
>> $PICSRC/configure ~/paramSets/case001
>> make -j install
>>
>>
>> Best,
>> Axel
>>
>> On 27.04.2016 12:35, Dr. Ajit Upadhyay wrote:
>>> Dear René,
>>>
>>> Thanks for such a prompt reply. The log files, I sent were from the
>>> release-0.1.2 branch. However, I did try "master"  as well, but the
>>> error
>>> remains same.
>>>
>>> $PICSRC/configure ~/paramSets/case001
>>>
>>> in release-0.1.2 branch as well as master branch gives following
>>> error:-
>>>
>>>
>>> CMake Error at CMakeLists.txt:38 (add_subdirectory):
>>>    The binary directory
>>>      /home/ajitup/build/build_picongpu
>>>    is already used to build a source directory.  It cannot be used to
>>> build
>>> source directory
>>>      /home/ajitup/code.PIConGPU/picongpu-master/src/picongpu
>>> Specify a unique binary directory name.
>>>
>>> CMake Error at CMakeLists.txt:38 (add_subdirectory):
>>>    The binary directory
>>>      /home/ajitup/build/build_picongpu
>>>    is already used to build a source directory.  It cannot be used to
>>> build
>>> source directory
>>>      /home/ajitup/code.PIConGPU/picongpu-master/src/picongpu
>>>    Specify a unique binary directory name.
>>>
>>>
>>> Whereas, there is no quota set by HPC system and I am able to
>>> write/create
>>> a file/folder in ~/build directory. my PICSRC is ~/src/picongpu and I
>>> build the code in ~/build directory. Further error is in CMakeError.log
>>> :
>>>
>>>
>>> Determining if the pthread_create exist failed with the following
>>> output:
>>> Change Dir: /home/ajitup/build/CMakeFiles/CMakeTmp
>>>
>>> Run Build Command:"/usr/bin/gmake" "cmTC_d035f/fast"
>>> /usr/bin/gmake -f CMakeFiles/cmTC_d035f.dir/build.make
>>> CMakeFiles/cmTC_d035f.dir/build
>>> gmake[1]: Entering directory '/home/ajitup/build/CMakeFiles/CMakeTmp'
>>> Building C object CMakeFiles/cmTC_d035f.dir/CheckSymbolExists.c.o
>>> /usr/bin/cc    -fPIC    -o
>>> CMakeFiles/cmTC_d035f.dir/CheckSymbolExists.c.o
>>>    -c /home/ajitup/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
>>> Linking C executable cmTC_d035f
>>> /usr/local/bin/cmake -E cmake_link_script
>>> CMakeFiles/cmTC_d035f.dir/link.txt --verbose=1
>>> /usr/bin/cc  -fPIC     CMakeFiles/cmTC_d035f.dir/CheckSymbolExists.c.o
>>> -o
>>> cmTC_d035f -rdynamic
>>> CMakeFiles/cmTC_d035f.dir/CheckSymbolExists.c.o: In function `main':
>>> CheckSymbolExists.c:(.text+0x1b): undefined reference to
>>> `pthread_create'
>>> collect2: error: ld returned 1 exit status
>>> CMakeFiles/cmTC_d035f.dir/build.make:97: recipe for target 'cmTC_d035f'
>>> failed
>>> gmake[1]: *** [cmTC_d035f] Error 1
>>> gmake[1]: Leaving directory '/home/ajitup/build/CMakeFiles/CMakeTmp'
>>> Makefile:126: recipe for target 'cmTC_d035f/fast' failed
>>> gmake: *** [cmTC_d035f/fast] Error 2
>>>
>>> File /home/ajitup/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
>>> /* */
>>> #include <pthread.h>
>>>
>>> int main(int argc, char** argv)
>>> {
>>>    (void)argv;
>>> #ifndef pthread_create
>>>    return ((int*)(&pthread_create))[argc];
>>> #else
>>>    (void)argc;
>>>    return 0;
>>> #endif
>>> }
>>>
>>>
>>> I have attached some test files which I compiled to check for
>>> pthread_create function using    $cc -lpthread ***.c -o ***.out
>>> and they compiled. A search for libpthread shows it in /lib as well as
>>> /lib64 in system-root. I have gcc 4.8.5, and cuda 7.5. I did try dev
>>> branch, but as you suggested it will require enabling c++11 support.
>>> The
>>> error in dev branch is:
>>>
>>> Please enable C++11 with `-std=c++11` or `-DCMAKE_CXX_STANDARD=11`
>>> when
>>> compiling with nvcc 7.5
>>>
>>> I will try adding c++11 support and let you know, but the
>>> CMakeError.log
>>> shows lpthread issue even in dev branch.
>>>
>>> regards,
>>> ajit
>>>
>>> Attachements:  Cmake log files for release-branch
>>>                 test codes for lpthread
>>>                 CMakeLists.txt from release-0.1.2
>>>
>>>
>>>> ---------------------------- Original Message
>>>> ----------------------------
>>>> Subject: Re: Help on PIConGPU?
>>>> From:    René Widera <r.widera@hzdr.de>
>>>> Date:    Wed, April 27, 2016 2:14 pm
>>>> To:      "Dr. Ajit Upadhyay" <ajitup@rrcat.gov.in>
>>>> ------------------------------------------------------------------
>>>> Dear Dr. Ajit Upadhyay,
>>>>
>>>> thank you for participate our project PIConGPU.
>>>>
>>>> Please subscribe at our mailing list [1] for future issues with
>>>> picongpu. The mailing list helps the community if other run in equal
>>>> issues.
>>>>
>>>> Currently I have only looked very fast to your problem, I will take a
>>>> deeper analysis tomorrow.
>>>> Which version of PIConGPU you used? master or dev
>>>> For cuda 7.5 please switch to `dev` because as I remember we need to
>>>> enable C++11 for cuda 7.5 else PIConGPU will not compile and the
>>>> master
>>>> is not C++11 compatible.
>>>> Please keep in mind that the branch `dev` is our working branch and
>>>> interfaces can be changed.
>>>> There will be a new release in one or two weeks available.
>>>>
>>>> I looked first at your file `build_output_shell` and found the error
>>>> ```
>>>> CMake Error at CMakeLists.txt:38 (add_subdirectory):
>>>>     The binary directory
>>>>       /home/ajitup/build/build_picongpu
>>>> ```
>>>> This looks like you are not allowed to create directories in
>>>> `~/build`.
>>>> Maybe your HPC System set a quota for your home directory which
>>>> results
>>>> in the case that no new files can be created. Could you please check
>>>> this behavior.
>>>>
>>>> pthread issue:
>>>>
>>>> Could you please provide me with the cmake script and all needed
>>>> files.
>>>> It looks like the linker flag `lpthread` is missing in your example.
>>>>
>>>> If some of the issues are solved till tomorrow please give me a
>>>> feedback.
>>>>
>>>> btw: please skip the `Dr.` before my name but I would be glad to get a
>>>> honorary degree ;-)
>>>>
>>>> best regards,
>>>> René
>>>>
>>>> [1]
>>>> https://github.com/ComputationalRadiationPhysics/picongpu/tree/dev#users
>>>>
>>>> On 27.04.2016 09:43, Dr. Ajit Upadhyay wrote:
>>>>> Dear Dr. René Widera,
>>>>>
>>>>> I downloaded the release-0.1.2 branch of code and tried to compile it
>>> on a HP Z840 (Intel Xeon E5-2630v3 2.4 1866 8C x 2, 128GB memory)
>>> workstation with two Nividia Quadro 4200 GPUs (compatible with CUDA).
>>> The OS on my workstation is openSuSe Leap 42.1 with cuda-7.5. I have
>>> tested some examples from the nvidia-cuda library and they are working
>>> fine.
>>>>>
>>>>> I have compiled all the libraries required by PIConGPU successfully
>>>>> and
>>> placed them as per the instructions in /picongpu/src/install.md file.
>>> However, when I try to compile the code itself, it gives a strange
>>> error> of pthread_create function (please look at the attached
>>> CMakeError.log).
>>>>>
>>>>> I did check that the relevant library is in its place
>>>>> (/lib/libpthread-2.19.so, glibc-2.19-19.1_x86_64). I did google for
>>>>> the
>>> error but could not resolve this issue as the problem seems to be with
>>> "configure" script of the picongpu code.
>>>>>
>>>>> I made a test program from CMakeError.log file and compiled it
>>> separately and it compiles (please have a look at pthread_check_log, a
>>> few lines of code are listed and it compiles all these which uses this
>>> function). I have attached  the output dumped on the linux-terminal in
>>> file build_output_shell. Other files created by cmake are also
>>> attached.
>>>>>
>>>>> Could you please point out where is the fault in my setup of this
>>>>> code
>>>>> or what should I do to run this code.
>>>>>
>>>>> Regards,
>>>>>
>>>>>
>>>>> #############################################################
>>>>> This message is sent to you because you are subscribed to
>>>>>    the mailing list <picongpu-users@hzdr.de>.
>>>>> To unsubscribe, E-mail to: <picongpu-users-off@hzdr.de>
>>>>> To switch to the DIGEST mode, E-mail to
>>>>> <picongpu-users-digest@hzdr.de>
>>>>> To switch to the INDEX mode, E-mail to <picongpu-users-index@hzdr.de>
>>>>> Send administrative queries to  <picongpu-users-request@hzdr.de>
>>>>>
>>
>
> --
> René Widera
> Abteilung Laser-Teilchenbeschleunigung (FWKT)
> Helmholtz-Zentrum Dresden-Rossendorf
> Tel: +49 (0351) 260 3543
> r.widera@hzdr.de
> http://www.hzdr.de
>
> Vorstand: Prof. Dr. Dr. h. c. Roland Sauerbrey,
>            Prof. Dr. Dr. h. c. Peter Joehnk
> Vereinsregister: VR 1693 beim Amtsgericht Dresden
>
> #############################################################
> This message is sent to you because you are subscribed to
>   the mailing list <picongpu-users@hzdr.de>.
> To unsubscribe, E-mail to: <picongpu-users-off@hzdr.de>
> To switch to the DIGEST mode, E-mail to <picongpu-users-digest@hzdr.de>
> To switch to the INDEX mode, E-mail to <picongpu-users-index@hzdr.de>
> Send administrative queries to  <picongpu-users-request@hzdr.de>
>
>


Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to Listmaster