2017-02-14 5 views
0

제안 된 cmake 경로를 사용하여 trilinos 패키지를 설치하려고합니다. 나는 cmake에 대한 경험이 없지만 발견 한 샘플 bash 스크립트가있다. 이 스크립트를 실행하려고하면 오류가 발생합니다.cmake는 변수가 디렉토리라고 생각합니다

CMake 오류 : 원본 디렉터리 "/ home/USER/code/packages/trilinos_build/MPI_EXEC : FILEPATH =/usr/bin/pkg/mpiexec"이 없습니다. --help를 지정하거나 CMake GUI에서 도움말 버튼을 누릅니다.

나는 cmake 의사를 확인했고 구문이 정확한지 확신합니다. 무엇이 누락 되었습니까?

#!/bin/bash 

# Set this to the root of your Trilinos source directory. 
TRILINOS_PATH=../trilinos_source 
TRILINOS_BUILD_PATH=./ 

# 
# You can invoke this shell script with additional command-line 
# arguments. They will be passed directly to CMake. 
# 
[email protected] 

# 
# Each invocation of CMake caches the values of build options in a 
# CMakeCache.txt file. If you run CMake again without deleting the 
# CMakeCache.txt file, CMake won't notice any build options that have 
# changed, because it found their original values in the cache file. 
# Deleting the CMakeCache.txt file before invoking CMake will insure 
# that CMake learns about any build options you may have changed. 
# Experience will teach you when you may omit this step. 
# 
rm -f CMakeCache.txt 

# 
# Enable all primary stable Trilinos packages. 
# 
cmake \ 
    -D CMAKE_INSTALL_PREFIX:FILEPATH="${TRILINOS_BUILD_PATH}/mpi" \ 
    -D CMAKE_BUILD_TYPE:STRING=RELEASE \ 
    -D Trilinos_ENABLE_TESTS:BOOL=OFF \ 
    -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF \ 
    -D TPL_ENABLE_MPI:BOOL=ON \ 
    -D MPI_EXEC:FILEPATH="/usr/bin/pkg/mpiexec" \ 


$EXTRA_ARGS \ 
$TRILINOS_PATH 
+0

확신 할 수는 없지만'$ EXTRA_ARGS'와 더 많은 매개 변수가 cmake에 전달되지 않습니다 : 이전 매개 변수에서 여러 줄로 구분되며 줄 끝의 '\'는 다음 줄에서만 계속을 제공합니다 선. BTW, 스크립트를 사용하는 대신 적절한 매개 변수를 사용하여 직접 호출하여'cmake' 호출을 디버깅 할 수 있습니다. – Tsyvarev

+0

그게 전부 였어, 너무 많은 공백. 감사. – roro

답변

0

내가 cmake와 비슷한 문제를 가지고, 그것은 흰색 마지막 라인과 $해서 extra_args \ 사이에 들어가 있기 때문에이다. 빈 줄을 제거하면 오류가 사라집니다.

그래서 파일은 다음과 같이해야한다 : 또한

#!/bin/bash 

# Set this to the root of your Trilinos source directory. 
TRILINOS_PATH=../trilinos_source 
TRILINOS_BUILD_PATH=./ 

# 
# You can invoke this shell script with additional command-line 
# arguments. They will be passed directly to CMake. 
# 
[email protected] 

# 
# Each invocation of CMake caches the values of build options in a 
# CMakeCache.txt file. If you run CMake again without deleting the 
# CMakeCache.txt file, CMake won't notice any build options that have 
# changed, because it found their original values in the cache file. 
# Deleting the CMakeCache.txt file before invoking CMake will insure 
# that CMake learns about any build options you may have changed. 
# Experience will teach you when you may omit this step. 
# 
rm -f CMakeCache.txt 

# 
# Enable all primary stable Trilinos packages. 
# 
cmake \ 
    -D CMAKE_INSTALL_PREFIX:FILEPATH="${TRILINOS_BUILD_PATH}/mpi" \ 
    -D CMAKE_BUILD_TYPE:STRING=RELEASE \ 
    -D Trilinos_ENABLE_TESTS:BOOL=OFF \ 
    -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF \ 
    -D TPL_ENABLE_MPI:BOOL=ON \ 
    -D MPI_EXEC:FILEPATH="/usr/bin/pkg/mpiexec" \ 
$EXTRA_ARGS \ 
$TRILINOS_PATH 

같은 오류가 표시됩니다 -D 옵션 사이의 번호로 모든 라인을 언급합니다. cmake 이후 \ 모든 줄은 연속적이어야합니다.

희망 하시겠습니까?