Mailing List picongpu-users@hzdr.de Message #50
From: Huebl, Axel <a.huebl@hzdr.de>
Subject: Re: [PIConGPU-Users] PIConGPU compilation -lpthread error
Date: Wed, 27 Apr 2016 17:13:24 +0200
To: <picongpu-users@hzdr.de>
Signed Data (Text SHA256)
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>
>>>

--

Axel Huebl
Phone +49 351 260 3582
https://www.hzdr.de/crp
Computational Radiation Physics
Laser Particle Acceleration Division
Helmholtz-Zentrum Dresden - Rossendorf e.V.

Bautzner Landstrasse 400, 01328 Dresden
POB 510119, D-01314 Dresden
Vorstand: Prof. Dr.Dr.h.c. R. Sauerbrey
          Prof. Dr.Dr.h.c. P. Joehnk
VR 1693 beim Amtsgericht Dresden

Content Unaltered as verified By:
Huebl, Axel <a.huebl@hzdr.de>
Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to Listmaster