gpt4 book ai didi

linux - 在 Kubuntu 设备上执行命令

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:05:29 29 4
gpt4 key购买 nike

我必须编译源代码才能获得可执行文件。但是,由于存在括号,make 命令无法编译,并显示以下错误消息:

sh: 4: Syntax error: "(" unexpected (expecting ")")
Makefile: 36: recipe for target 'dynamic' failed
make[1]: [dynamic] Error 2

我访问了附在这篇文章中的 Makefile:

# get PETSC_DIR, PETSC_ARCH and MPIHOME from NEMO 5 build system
#LIBMESH_VERSION = 0.8.0
include ../../make.inc

#all: libmesh/configure static dynamic
all: libmesh/configure dynamic
# <ss 12/09/10> static stuff is only needed on jaguar

libmesh/configure:
@echo "Extracting libmesh-$(LIBMESH_VERSION).tar.gz..."
tar zxf libmesh-$(LIBMESH_VERSION).tar.gz

# <ss 17.7.2010> PETSc now is mandatory for libmesh - however, libmesh takes MPI configuration from petsc configuration files in that case.
# libmesh searches for $PETSC_DIR/include/petsc.h and needs $PETSC_ARCH to be set
# On nanohub, things got messed up and OpenMIP libraries linked to executables. to prevent this, I had to disable VTK within libmesh.
# <ss 13.8.2010> disabled tetgen because libtetgen.a seems to contain an int main() which makes static linking impossible.
# Note: the 'make clean' before 'make all' for the contributions is mandatory, otherwise shared LASPACK will not compile.

static: libmesh/configure
@echo "###########################################"
@echo "# #"
@echo "# Configuring Libmesh (STATIC libraries) #"
@echo "# #"
@echo "###########################################"
(export libmesh_CXXFLAGS=$(libmesh_CXXFLAGS) ; \
export libmesh_INCLUDE=$(libmesh_INCLUDE); \
export SLEPC_DIR=$(SLEPC_DIR); \
cd libmesh; ./configure PETSC_DIR=$(PETSC_REAL_BUILD) MPIHOME=$(MPIHOME) PETSC_ARCH=$(PETSC_REAL_ARCH) \
F77="$(MPIF77)" CC="$(MPICC)" GCC="$(GCC)" CXX="$(MPICXX)" --enable-vtk --with-vtk-include=$(VTKINC_PATH) \
--with-vtk-lib=$(VTKLIB_PATH) --disable-tetgen --disable-tecplot \
--disable-nemesis --disable-shared --enable-parmesh --enable-amr; \
make clean; make; \
cd contrib; make clean; make all)

dynamic: libmesh/configure
@echo "###########################################"
@echo "# #"
@echo "# Configuring Libmesh (DYNAMIC libraries) #"
@echo "# #"
@echo "###########################################"
(export libmesh_CXXFLAGS=$(libmesh_CXXFLAGS); \
export libmesh_CPPFLAGS=$(libmesh_CPPFLAGS); \
export libmesh_INCLUDE=$(libmesh_INCLUDE); \
export METHODS=(opt,dbg);\
export SLEPC_DIR=$(SLEPC_DIR)/build-real; \
cd libmesh; ./configure PETSC_DIR=$(PETSC_REAL_BUILD) MPIHOME=$(MPIHOME) PETSC_ARCH=$(PETSC_REAL_ARCH) \
F77="$(MPIF77)" CC="$(MPICC)" GCC="$(GCC)" CXX="$(MPICXX)" --enable-vtk --with-vtk-include=$(VTKINC_PATH) \
--with-vtk-lib=$(VTKLIB_PATH) --disable-tetgen --enable-triangle --enable-slepc --disable-nemesis --disable-cxx11 --disable-strict-lgpl \
--enable-parmesh --enable-amr --enable-shared=yes --disable-glibcxx-debugging ; \
make clean; make --jobs=4; \
cd contrib; make clean; make all --jobs=4;)

clean:
cd libmesh; make clean

distclean:
rm -rf libmesh

我认为问题在于强制使用 bash shell,正如我从其他帖子中读到的那样。我这样做了,但没有用。我使用 Kubuntu 运行它:Ubuntu 的 KDE 版本。非常感谢您的帮助。

最佳答案

The project's README.md看起来你应该用过

../configure --with-methods="opt dbg"

(没有括号,空格分隔)而不是(显然)../configure --with-methods="(opt,dbg)"

关于linux - 在 Kubuntu 设备上执行命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47512956/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com