pymad / cpymad

cPyMAD is a python interface to Mad-X using cython and libmadx
http://cern.ch/pymad
Apache License 2.0
3 stars 3 forks source link

CMake Error: the source directory""does not appear to contain CMakeLists.txt. #76

Closed Landau1908 closed 10 years ago

Landau1908 commented 10 years ago

hi, everyone! recently, i want to learn about cpymad as a newbie. when i install cpymad on win7, however, there exists a error, saying CMake Error: the source directory "d:/install/windows setup/madx-madx.r4920.tar" does not appear to contain CMakeLists.txt. how to solve the problem? could anyone give a help? thanks!

coldfix commented 10 years ago

Hey, can you give further details what exactly you did before encountering this error? Did you follow the install recommendations? My first guess is, you downloaded the MAD-X source but either the download was incomplete or you did not properly extract the files. You might need to unpack twice - depending on your unpack tool (.tar is a file container format, .gz is a compression format). Is that the problem?

Best regards, Thomas

Landau1908 commented 10 years ago

“Did you follow the install recommendations?” Yes,i did follow the install recommendations.

"can you give further details what exactly you did before encountering this error?" According to the recommendations, I download MAD-X source "madx-madx.r4920.tar.gz" and unpack to a default folder "madx-madx.r4920.tar" using 7-Zip on win7, and right-click on the folder and select Open enhanced console here menu. After doing so, i run the commands: //mkdir build cd build cmake -G "MinGW Makefiles" -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_INSTALL_PREFIX=..\install .. make install// It is the time this error occurs.

coldfix commented 10 years ago

You might need to unpack twice - depending on your unpack tool (.tar is a file container format, .gz is a compression format). Is that the problem? I.e. the folder you extracted, has it lots of files or just one? (Type dir in the shell and there should be lots of stuff, also type echo %cd%).

Sorry, I won't be available all day until evening.

B.t.w. you can use github flavored markdown in your comments. Most of that is not important, but wrapping code segments is (so there are no line breaks etc introduced).

Thomas

Landau1908 commented 10 years ago

I unpack the MAD-X source "madx-madx.r4920.tar.gz" twice, and get a folder "madx-madx.r4920" which contains only a file "madx-madx.r4920". when I excute the steps according to the recommendations the errors still exist as mentioned before.

B.t.w. it's my first time to use GitHub, so I'm very sorry.

coldfix commented 10 years ago

Hey, no problem, sorry for the misunderstanding. You need to extract the file madx-madx.r4920 as well. It contains the actual source folder. (Should work by right-click->extract when having 7z installed). Let me hear if you have any more problems. You will probably also need some help with the API since it is not well documented a.t.m, and there is no tutorial, sorry. Just ask anything you want to know, and I'll try to answer as fast as I can.

Landau1908 commented 10 years ago

Hi, Thomas, Thanks for your prompt reply!I‘m very sorry my network broken in last 3 days. For your further advice I will try it again. Thanks!

Landau1908 commented 10 years ago

Hey, Thomas With your recommendation, I unpack the MAD-X source three times. Indeed, the unpacked folder cotains lots of stuff. And then, I run the commands according to the steps used as before, however, there existing errors which are different from the mentioned before. Below is the whole process occured in commands window. B.t.w. i don't know the type of syntax, so i use python as the language identifier.

D:\install\Windows setup\madX.r4920>mkdir build                  

D:\install\Windows setup\madX.r4920>cd build                     

D:\install\Windows setup\madX.r4920\build>cmake -G "MinGW Makefil
es" -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_INSTALL_PREFIX=..\instal
l ..                                                             
-- The C compiler identification is GNU 4.8.1                    
-- The CXX compiler identification is GNU 4.8.1                  
-- The Fortran compiler identification is GNU                    
-- Check for working C compiler: D:/Program Files/MinGW32-xy/bin/
gcc.exe                                                          
-- Check for working C compiler: D:/Program Files/MinGW32-xy/bin/
gcc.exe -- works                                                 
-- Detecting C compiler ABI info                                 
-- Detecting C compiler ABI info - done                          
-- Check for working CXX compiler: D:/Program Files/MinGW32-xy/bi
n/g++.exe                                                        
-- Check for working CXX compiler: D:/Program Files/MinGW32-xy/bi
n/g++.exe -- works                                               
-- Detecting CXX compiler ABI info                               
-- Detecting CXX compiler ABI info - done                        
-- Check for working Fortran compiler: D:/Program Files/MinGW32-x
y/bin/gfortran.exe                                               
-- Check for working Fortran compiler: D:/Program Files/MinGW32-x
y/bin/gfortran.exe  -- works                                     
-- Detecting Fortran compiler ABI info                           
-- Detecting Fortran compiler ABI info - done                    
-- Checking whether D:/Program Files/MinGW32-xy/bin/gfortran.exe 
supports Fortran 90                                              
-- Checking whether D:/Program Files/MinGW32-xy/bin/gfortran.exe 
supports Fortran 90 -- yes                                       
-- Mad-X version: 5.02.02                                        
-- Version date: 2014.07.04                                      
-- Building a development version                                
-- Looking for SDDS libraries                                    
-- Did not find libSDDS1c                                        
-- Did not find libSDDS1                                         
-- Did not find librpnlib                                        
-- Did not find libmdbmth                                        
-- Did not find libmdblib                                        
-- Did not find libgsl                                           
-- Looking for SDDS libraries - not found.                       
-- 32 bit build                                                  
-- Looking for include file pthread.h                            
-- Looking for include file 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 - not found            
-- Looking for pthread_create in pthread                         
-- Looking for pthread_create in pthread - found                 
-- Found Threads: TRUE                                           
-- A library with BLAS API not found. Please specify library loca
tion.                                                            
-- LAPACK requires BLAS                                          
-- A library with LAPACK API not found. Please specify library lo
cation.                                                          
-- NTPSA turned on                                               
CMake Warning (dev) at cmake/numdiff_macros.cmake:1 (get_target_p
roperty):                                                        
  Policy CMP0026 is not set: Disallow use of the LOCATION target 
property.                                                        
  Run "cmake --help-policy CMP0026" for policy details.  Use the 
cmake_policy                                                     
  command to set the policy and suppress this warning.           

  The LOCATION property should not be read from target "madxbin".
  Use the                                                        
  target name directly with add_custom_command, or use the genera
tor                                                              
  expression $<TARGET_FILE>, as appropriate.                     

Call Stack (most recent call first):                             
  cmake/numdifftests.cmake:1 (include)                           
  CMakeLists.txt:71 (include)                                    
This warning is for project developers.  Use -Wno-dev to suppress
 it.                                                             

CMake Warning (dev) at cmake/numdiff_macros.cmake:2 (get_target_p
roperty):                                                        
  Policy CMP0026 is not set: Disallow use of the LOCATION target 
property.                                                        
  Run "cmake --help-policy CMP0026" for policy details.  Use the 
cmake_policy                                                     
  command to set the policy and suppress this warning.           

  The LOCATION property should not be read from target "numdiff".
  Use the                                                        
  target name directly with add_custom_command, or use the genera
tor                                                              
  expression $<TARGET_FILE>, as appropriate.                     

Call Stack (most recent call first):                             
  cmake/numdifftests.cmake:1 (include)                           
  CMakeLists.txt:71 (include)                                    
This warning is for project developers.  Use -Wno-dev to suppress
 it.                                                             

-- Copying tests/share folder, this will take some time...       
-- Configuring done                                              
-- Generating done                                               
-- Build files have been written to: D:/install/Windows setup/mad
X.r4920/build                                                    

D:\install\Windows setup\madX.r4920\build>make install           
Scanning dependencies of target ptc                              
[  0%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/a_
scratch_size.f90.obj                                             
[  1%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/b_
da_arrays_all.f90.obj                                            
[  2%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/c_
dabnew.f90.obj                                                   
[  2%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/d_
lielib.f90.obj                                                   
[  3%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/h_
definition.f90.obj                                               
[  4%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/i_
tpsa.f90.obj                                                     
[  4%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/j_
tpsalie.f90.obj                                                  
[  5%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/k_
tpsalie_analysis.f90.obj                                         
[  6%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/l_
complex_taylor.f90.obj                                           
[  6%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/m_
real_polymorph.f90.obj                                           
[  7%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/n_
complex_polymorph.f90.obj                                        
[  8%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/o_
tree_element.f90.obj                                             
[  9%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/Sa
_extend_poly.f90.obj                                             
[  9%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/Sc
_euclidean.f90.obj                                               
[ 10%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/Sd
_frame.f90.obj                                                   
[ 11%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/Sb
_sagan_pol_arbitrary.f90.obj                                     
[ 12%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/Se
_status.f90.obj                                                  
[ 12%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/Sf
_def_all_kinds.f90.obj                                           
[ 13%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/Sh
_def_kind.f90.obj                                                
[ 14%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/Sg
_sagan_wiggler.f90.obj                                           
[ 14%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/Si
_def_element.f90.obj                                             
[ 15%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/Sk
_link_list.f90.obj                                               
[ 16%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/Sl
_family.f90.obj                                                  
[ 17%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/Sm
_tracking.f90.obj                                                
[ 17%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/Sm
a0_beam_beam_ptc.f90.obj                                         
[ 18%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/Sm
a_multiparticle.f90.obj                                          
[ 18%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/Sn
_mad_like.f90.obj                                                
[ 19%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/So
_fitting.f90.obj                                                 
[ 19%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/Sp
_keywords.f90.obj                                                
[ 20%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/Sq
_orbit_ptc.f90.obj                                               
[ 20%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/Sr
_spin.f90.obj                                                    
[ 21%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/Sr
a_fitting.f90.obj                                                
[ 22%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/Ss
_fake_mad.f90.obj                                                
[ 23%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/St
_pointers.f90.obj                                                
[ 23%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/pt
cinterface.f90.obj                                               
[ 24%] Building Fortran object libs/ptc/src/CMakeFiles/ptc.dir/Sp
b_fake_gino_sub.f90.obj                                          
Linking Fortran static library libptc.a                          
[ 24%] Built target ptc                                          
Scanning dependencies of target madx                             
[ 25%] Building Fortran object src/CMakeFiles/madx.dir/c_dabnew_b
erz.f90.obj                                                      
[ 25%] Building Fortran object src/CMakeFiles/madx.dir/util.f90.o
bj                                                               
[ 26%] Building Fortran object src/CMakeFiles/madx.dir/madx_ptc_i
ntstate.f90.obj                                                  
[ 27%] Building Fortran object src/CMakeFiles/madx.dir/madx_ptc_k
nobs.f90.obj                                                     
[ 28%] Building Fortran object src/CMakeFiles/madx.dir/madx_ptc_s
etcavs.f90.obj                                                   
[ 28%] Building Fortran object src/CMakeFiles/madx.dir/madx_ptc_m
odule.f90.obj                                                    
[ 29%] Building Fortran object src/CMakeFiles/madx.dir/madx_ptc_d
istrib.f90.obj                                                   
[ 29%] Building Fortran object src/CMakeFiles/madx.dir/madx_ptc_e
placement.f90.obj                                                
[ 30%] Building Fortran object src/CMakeFiles/madx.dir/madx_ptc_n
ormal.f90.obj                                                    
[ 30%] Building Fortran object src/CMakeFiles/madx.dir/madx_ptc_s
cript.f90.obj                                                    
[ 30%] Building Fortran object src/CMakeFiles/madx.dir/madx_ptc_t
rack_run.f90.obj                                                 
[ 31%] Building Fortran object src/CMakeFiles/madx.dir/madx_ptc_t
rackcavs.f90.obj                                                 
[ 32%] Building Fortran object src/CMakeFiles/madx.dir/madx_ptc_t
wiss.f90.obj                                                     
[ 33%] Building Fortran object src/CMakeFiles/madx.dir/ptc_export
_xml.f90.obj                                                     
[ 33%] Building Fortran object src/CMakeFiles/madx.dir/c_tpsa_int
erface.F90.obj                                                   
[ 34%] Building C object src/CMakeFiles/madx.dir/mad_6track.c.obj

[ 34%] Building C object src/CMakeFiles/madx.dir/mad_aper.c.obj  
[ 35%] Building C object src/CMakeFiles/madx.dir/mad_api.c.obj   
[ 36%] Building C object src/CMakeFiles/madx.dir/mad_array.c.obj 
[ 36%] Building C object src/CMakeFiles/madx.dir/mad_beam.c.obj  
[ 37%] Building C object src/CMakeFiles/madx.dir/mad_cmd.c.obj   
[ 38%] Building C object src/CMakeFiles/madx.dir/mad_cmdin.c.obj 
[ 38%] Building C object src/CMakeFiles/madx.dir/mad_cmdpar.c.obj

[ 39%] Building C object src/CMakeFiles/madx.dir/mad_const.c.obj 
[ 40%] Building C object src/CMakeFiles/madx.dir/mad_core.c.obj  
[ 40%] Building C object src/CMakeFiles/madx.dir/mad_dict.c.obj  
[ 41%] Building C object src/CMakeFiles/madx.dir/mad_dynap.c.obj 
[ 42%] Building C object src/CMakeFiles/madx.dir/mad_elem.c.obj  
[ 42%] Building C object src/CMakeFiles/madx.dir/mad_elemdrift.c.
obj                                                              
[ 43%] Building C object src/CMakeFiles/madx.dir/mad_elemerr.c.ob
j                                                                
[ 44%] Building C object src/CMakeFiles/madx.dir/mad_elemmultp.c.
obj                                                              
[ 44%] Building C object src/CMakeFiles/madx.dir/mad_elemprobe.c.
obj                                                              
[ 45%] Building C object src/CMakeFiles/madx.dir/mad_elemrfc.c.ob
j                                                                
[ 46%] Building C object src/CMakeFiles/madx.dir/mad_emit.c.obj  
[ 46%] Building C object src/CMakeFiles/madx.dir/mad_err.c.obj   
[ 47%] Building C object src/CMakeFiles/madx.dir/mad_eval.c.obj  
[ 48%] Building C object src/CMakeFiles/madx.dir/mad_exec.c.obj  
[ 48%] Building C object src/CMakeFiles/madx.dir/mad_expr.c.obj  
[ 49%] Building C object src/CMakeFiles/madx.dir/mad_gcst.c.obj  
[ 50%] Building C object src/CMakeFiles/madx.dir/mad_gvar.c.obj  
[ 50%] Building C object src/CMakeFiles/madx.dir/mad_gxx11c.c.obj

[ 51%] Building C object src/CMakeFiles/madx.dir/mad_ibs.c.obj   
[ 52%] Building C object src/CMakeFiles/madx.dir/mad_inter.c.obj 
[ 52%] Building C object src/CMakeFiles/madx.dir/mad_macro.c.obj 
[ 53%] Building C object src/CMakeFiles/madx.dir/mad_main.c.obj  
In file included from d:\progra~1\mingw3~1\include\unistd.h:36:0,

                 from D:\install\Windows setup\madX.r4920\src\mad
_main.c:18:                                                      
d:\progra~1\mingw3~1\include\io.h:301:1: error: unknown type name
 'off64_t'                                                       
 __CRT_INLINE off64_t lseek64 (int, off64_t, int);               
 ^                                                               
d:\progra~1\mingw3~1\include\io.h:301:36: error: unknown type nam
e 'off64_t'                                                      
 __CRT_INLINE off64_t lseek64 (int, off64_t, int);               
                                    ^                            
d:\progra~1\mingw3~1\include\io.h:302:1: error: unknown type name
 'off64_t'                                                       
 __CRT_INLINE off64_t lseek64 (int fd, off64_t offset, int whence
) {                                                              
 ^                                                               
d:\progra~1\mingw3~1\include\io.h:302:39: error: unknown type nam
e 'off64_t'                                                      
 __CRT_INLINE off64_t lseek64 (int fd, off64_t offset, int whence
) {                                                              
                                       ^                         
In file included from D:\install\Windows setup\madX.r4920\src\mad
_main.c:18:0:                                                    
d:\progra~1\mingw3~1\include\unistd.h:65:20: error: unknown type 
name 'off_t'                                                     
 int ftruncate(int, off_t);                                      
                    ^                                            
d:\progra~1\mingw3~1\include\unistd.h:67:38: error: unknown type 
name 'off_t'                                                     
 __CRT_INLINE int ftruncate(int __fd, off_t __length)            
                                      ^                          
src\CMakeFiles\madx.dir\build.make:720: recipe for target 'src/CM
akeFiles/madx.dir/mad_main.c.obj' failed                         
make[2]: *** [src/CMakeFiles/madx.dir/mad_main.c.obj] Error 1    
CMakeFiles\Makefile2:1042: recipe for target 'src/CMakeFiles/madx
.dir/all' failed                                                 
make[1]: *** [src/CMakeFiles/madx.dir/all] Error 2               
Makefile:146: recipe for target 'all' failed                     
make: *** [all] Error 2                                          

D:\install\Windows setup\madX.r4920\build>
coldfix commented 10 years ago

Hey,

I have encountered that error before when using a custom mingw installation (not the one from python-xy) but was unable to fix it then. Though, I did not try very hard since it worked with my python-xy version... I will look into this more deepler later/tomorrow. I believe it has something to do with this issue. Which version of python-xy and cmake do you have installed? I will try to install the same the same versions and hope to get the same errors.

Building non-trivial applications on windows can suck really hard :/ but I will try my best to help you, just be patient:) I am currently searching for a new flat, so I don't have very much time, sorry.

BTW: For preformatted plain text you can just leave the language blank.

Best regards, Thomas

Landau1908 commented 10 years ago

hey, Thomas

I'm so sorry. my network crashed once again. The version of python-xy and cmake is python 2.7.6 and cmake 3.0.0 respectively. Good luck to you!

coldfix commented 10 years ago

Hey,

no need to apologize;)

I installed the newer version of python-xy and I have the same error now. The good news is, that this is quite easy to fix: just replace c99 with gnu99 in line 49 of madX\cmake\setupCompilerSpecifics.cmake, i.e. the line should read:

   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -funroll-loops -std=gnu99")

I will try to get this patch upstream. Otherwise I will add documentation on how to get around this problem.

I hope this will let you successfully build libmadx. For building CPyMAD itself, you will most certainly need advice from the Troubleshooting section.

All of this is quite unconfortable a.t.m., I hope, we can make it easier at some point...

Best regards, Thomas

coldfix commented 10 years ago

BTW: I am closing this issue, since the original problem (archive extraction..) is solved, but you are welcome to ask any further questions in a separate thread!