xbpeng / DeepMimic

Motion imitation with deep reinforcement learning.
https://xbpeng.github.io/projects/DeepMimic/index.html
MIT License
2.27k stars 485 forks source link

Issue with make python on Ubuntu 20.04 #187

Open Aliice8 opened 1 year ago

Aliice8 commented 1 year ago

Hi everyone, I followed the steps for the installation in the readme but I face this issue that I really don't know how to solve when running "make python" in ~/DeepMimic/DeepMimicCore directory.

Looking at similar issues, it may also be that I indicated the wrong path to dir in the MakeFile because I don't really get what dir should I put...

Anyways, this is the error:

`~/DeepMimic/DeepMimicCore$ make python swig -c++ -python DeepMimicCore.i clang++ -c -g -std=c++11 -O3 -Wall -fPIC -I./ -I/usr/local/include/eigen3 -I/usr/local/include/bullet -I -I -I/usr/local/include/bullet -lGLEW -lGL -lGLU -lglut -lBulletDynamics -lBulletCollision -lLinearMath -lm -lstdc++ DeepMimicCore.cpp DeepMimicCore_wrap.cxx -I/usr/include/python3.8 clang: warning: -lGLEW: 'linker' input unused [-Wunused-command-line-argument] clang: warning: -lGL: 'linker' input unused [-Wunused-command-line-argument] clang: warning: -lGLU: 'linker' input unused [-Wunused-command-line-argument] clang: warning: -lglut: 'linker' input unused [-Wunused-command-line-argument] clang: warning: -lBulletDynamics: 'linker' input unused [-Wunused-command-line-argument] clang: warning: -lBulletCollision: 'linker' input unused [-Wunused-command-line-argument] clang: warning: -lLinearMath: 'linker' input unused [-Wunused-command-line-argument] clang: warning: -lm: 'linker' input unused [-Wunused-command-line-argument] clang: warning: -Z-reserved-lib-stdc++: 'linker' input unused [-Wunused-command-line-argument] In file included from DeepMimicCore.cpp:3: In file included from ./render/DrawUtil.h:6: In file included from ./render/DrawMesh.h:21: ./render/VertexBuffer.h:20:32: warning: field 'mRenderState' will be initialized after field 'mLocalData' [-Wreorder-ctor] cVertexBuffer():mRenderID(0), mRenderState(NULL), mLocalData(NULL), ^ ./render/VertexBuffer.h:20:52: warning: field 'mLocalData' will be initialized after field 'mAttrInfo' [-Wreorder-ctor] cVertexBuffer():mRenderID(0), mRenderState(NULL), mLocalData(NULL), ^ ./render/VertexBuffer.h:21:15: warning: field 'mAttrInfo' will be initialized after field 'mNumAttr' [-Wreorder-ctor] mAttrInfo(NULL), mNumAttr(0), mSize(0) ^ ./render/VertexBuffer.h:21:32: warning: field 'mNumAttr' will be initialized after field 'mSize' [-Wreorder-ctor] mAttrInfo(NULL), mNumAttr(0), mSize(0) ^ ./render/VertexBuffer.h:23:77: warning: field 'mRenderState' will be initialized after field 'mLocalData' [-Wreorder-ctor] cVertexBuffer(GLuint bufferID, cRenderState &r_state):mRenderID(bufferID), mRenderState(&r_state), mLocalData(NULL), ^ ./render/VertexBuffer.h:23:101: warning: field 'mLocalData' will be initialized after field 'mAttrInfo' [-Wreorder-ctor] cVertexBuffer(GLuint bufferID, cRenderState &r_state):mRenderID(bufferID), mRenderState(&r_state), mLocalData(NULL), ^ ./render/VertexBuffer.h:24:40: warning: field 'mAttrInfo' will be initialized after field 'mNumAttr' [-Wreorder-ctor] mAttrInfo(NULL), mNumAttr(0), mSize(0) ^ ./render/VertexBuffer.h:24:57: warning: field 'mNumAttr' will be initialized after field 'mSize' [-Wreorder-ctor] mAttrInfo(NULL), mNumAttr(0), mSize(0) ^ ./render/VertexBuffer.h:26:69: warning: field 'mRenderState' will be initialized after field 'mNumAttr' [-Wreorder-ctor] cVertexBuffer(const cVertexBuffer &old): mRenderID(old.mRenderID), mRenderState(old.mRenderState), mNumAttr(old.mNumAttr), ^ ./render/VertexBuffer.h:26:101: warning: field 'mNumAttr' will be initialized after field 'mSize' [-Wreorder-ctor] cVertexBuffer(const cVertexBuffer &old): mRenderID(old.mRenderID), mRenderState(old.mRenderState), mNumAttr(old.mNumAttr), ^ In file included from DeepMimicCore.cpp:3: In file included from ./render/DrawUtil.h:6: In file included from ./render/DrawMesh.h:22: ./render/IBuffer.h:32:28: warning: field 'mRenderState' will be initialized after field 'mLocalData' [-Wreorder-ctor] cIBuffer(): mRenderID(0), mRenderState(NULL), mLocalData(NULL), mElemSize(0), mSize(0) ^ ./render/IBuffer.h:32:48: warning: field 'mLocalData' will be initialized after field 'mElemSize' [-Wreorder-ctor] cIBuffer(): mRenderID(0), mRenderState(NULL), mLocalData(NULL), mElemSize(0), mSize(0) ^ ./render/IBuffer.h:32:66: warning: field 'mElemSize' will be initialized after field 'mSize' [-Wreorder-ctor] cIBuffer(): mRenderID(0), mRenderState(NULL), mLocalData(NULL), mElemSize(0), mSize(0) ^ ./render/IBuffer.h:34:73: warning: field 'mRenderState' will be initialized after field 'mLocalData' [-Wreorder-ctor] cIBuffer(GLuint bufferID, cRenderState &r_state): mRenderID(bufferID), mRenderState(&r_state), mLocalData(NULL), mElemSize(0), mSize(0) ^ ./render/IBuffer.h:34:97: warning: field 'mLocalData' will be initialized after field 'mElemSize' [-Wreorder-ctor] cIBuffer(GLuint bufferID, cRenderState &r_state): mRenderID(bufferID), mRenderState(&r_state), mLocalData(NULL), mElemSize(0), mSize(0) ^ ./render/IBuffer.h:34:115: warning: field 'mElemSize' will be initialized after field 'mSize' [-Wreorder-ctor] cIBuffer(GLuint bufferID, cRenderState &r_state): mRenderID(bufferID), mRenderState(&r_state), mLocalData(NULL), mElemSize(0), mSize(0) ^ 16 warnings generated. In file included from DeepMimicCore_wrap.cxx:178: In file included from /usr/include/python3.8/Python.h:85: In file included from /usr/include/python3.8/pytime.h:6: In file included from /usr/include/python3.8/object.h:746: /usr/include/python3.8/cpython/object.h:177:16: warning: 'tp_print' is deprecated [-Wdeprecated-declarations] typedef struct _typeobject { ^ DeepMimicCore_wrap.cxx:1767:23: note: in implicit copy assignment operator for '_typeobject' first required here swigpyobject_type = tmp; ^ /usr/include/python3.8/cpython/object.h:260:5: note: 'tp_print' has been explicitly marked deprecated here Py_DEPRECATED(3.8) int (tp_print)(PyObject , FILE *, int); ^ /usr/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'

define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))

                                                 ^

In file included from DeepMimicCore_wrap.cxx:178: In file included from /usr/include/python3.8/Python.h:85: In file included from /usr/include/python3.8/pytime.h:6: In file included from /usr/include/python3.8/object.h:746: /usr/include/python3.8/cpython/object.h:177:16: warning: 'tp_print' is deprecated [-Wdeprecated-declarations] typedef struct _typeobject { ^ /usr/include/python3.8/cpython/object.h:260:5: note: 'tp_print' has been explicitly marked deprecated here Py_DEPRECATED(3.8) int (tp_print)(PyObject , FILE *, int); ^ /usr/include/python3.8/pyport.h:515:54: note: expanded from macro 'Py_DEPRECATED'

define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))

                                                 ^

2 warnings generated. clang++ -shared -std=c++11 -O3 -Wall -fPIC objs/Main.o objs/DeepMimicCore.o objs/util/IndexManager.o objs/util/Timer.o objs/util/DynamicTimeWarper.o objs/util/Annealer.o objs/util/ArgParser.o objs/util/Trajectory.o objs/util/Rand.o objs/util/MathUtil.o objs/util/FileUtil.o objs/util/JsonUtil.o objs/util/BVHReader.o objs/util/json/json_value.o objs/util/json/json_reader.o objs/util/json/json_writer.o objs/anim/ClipsController.o objs/anim/KinController.o objs/anim/Shape.o objs/anim/MotionController.o objs/anim/KinTree.o objs/anim/Character.o objs/anim/KinCharacter.o objs/anim/Motion.o objs/anim/KinCtrlBuilder.o objs/sim/ExpPDController.o objs/sim/CtController.o objs/sim/SimSphere.o objs/sim/CtrlBuilder.o objs/sim/ImpPDController.o objs/sim/SimObj.o objs/sim/PerturbManager.o objs/sim/RBDUtil.o objs/sim/SimBox.o objs/sim/SpAlg.o objs/sim/SimRigidBody.o objs/sim/SimCapsule.o objs/sim/Controller.o objs/sim/CharController.o objs/sim/SimBodyLink.o objs/sim/CtCtrlUtil.o objs/sim/AgentRegistry.o objs/sim/CtVelController.o objs/sim/RBDModel.o objs/sim/DeepMimicCharController.o objs/sim/ObjTracer.o objs/sim/CtPDController.o objs/sim/SimPlane.o objs/sim/SimBodyJoint.o objs/sim/GroundBuilder.o objs/sim/World.o objs/sim/MultiBody.o objs/sim/SimCharacter.o objs/sim/ContactManager.o objs/sim/SimCharBuilder.o objs/sim/PDController.o objs/sim/SimCylinder.o objs/sim/SimJoint.o objs/sim/Ground.o objs/sim/GroundPlane.o objs/sim/SimCharGeneral.o objs/sim/Perturb.o objs/render/DrawMesh.o objs/render/DrawPerturb.o objs/render/DrawWorld.o objs/render/GraphUtil.o objs/render/DrawObj.o objs/render/VertexBuffer.o objs/render/DrawUtil.o objs/render/Camera.o objs/render/TextureDesc.o objs/render/MeshUtil.o objs/render/DrawKinTree.o objs/render/TextureUtil.o objs/render/IBuffer.o objs/render/Shader.o objs/render/DrawSimCharacter.o objs/render/ShadowMap.o objs/render/MatrixStack.o objs/render/DrawCharacter.o objs/render/DrawGround.o objs/render/lodepng/lodepng_util.o objs/render/lodepng/lodepng.o objs/scenes/DrawSceneSimChar.o objs/scenes/DrawSceneTargetAMP.o objs/scenes/SceneImitate.o objs/scenes/Scene.o objs/scenes/RLSceneSimChar.o objs/scenes/SceneHeadingAMP.o objs/scenes/DrawSceneKinChar.o objs/scenes/DrawSceneDribbleAMP.o objs/scenes/SceneSimChar.o objs/scenes/SceneTargetAMP.o objs/scenes/RLScene.o objs/scenes/DrawSceneStrikeAMP.o objs/scenes/DrawSceneHeadingAMPGetup.o objs/scenes/SceneKinChar.o objs/scenes/SceneStrikeAMP.o objs/scenes/DrawSceneImitate.o objs/scenes/DrawRLScene.o objs/scenes/DrawScene.o objs/scenes/SceneBuilder.o objs/scenes/DrawSceneImitateAMP.o objs/scenes/SceneDribbleAMP.o objs/scenes/DrawSceneHeadingAMP.o objs/scenes/SceneImitateAMP.o objs/scenes/SceneHeadingAMPGetup.o -lGLEW -lGL -lGLU -lglut -lBulletDynamics -lBulletCollision -lLinearMath -lm -lstdc++ DeepMimicCore_wrap.o -o _DeepMimicCore.so -L/usr/lib/ -lpython3.8 -L -L -L clang: error: argument to '-L' is missing (expected 1 value) make: *** [Makefile:76: python] Error 1`

I really hope someone can help me!!

Sun-Shun commented 1 year ago

I have the same question

Sun-Shun commented 1 year ago

请使用此文件代替你的Makefile文件 https://github.com/zhaolongkzz/DeepMimic_configuration/blob/master/DeepMimicCore/Makefile

AdityaKapoor74 commented 1 year ago

@Sun-Shun @Aliice8 you might want to try this

BIN=Main
OBJ_DIR = objs
MKDIR = mkdir -p

# Reminder: these variables must be set as environment variables if the corresponding dev libs are not installed in the system: eg:
# export EIGEN_DIR = ../../libraries/eigen
# export BULLET_INC_DIR = ../../libraries/bullet3/src
# export BULLET_INC_DIR = third/bullet3-2.88/build_cmake/install/include/bullet/
# export BULLET_LIB_DIR = third/bullet3-2.88/build_cmake/install/lib
# export GLEW_INC_DIR = third/glew-2.1.0/install/usr/include/
# export GLEW_LIB_DIR = third/glew-2.1.0/lib/
# export FREEGLUT_INC_DIR = third/freeglut-3.0.0/install/include/
# export FREEGLUT_LIB_DIR = third/freeglut-3.0.0/install/lib

PYTHON_INC = /usr/include/python3.8
PYTHON_LIB = /usr/lib/python3.8
EIGEN_DIR = ../../../../../Downloads/eigen-3.4.0
BULLET_INC_DIR = ../../../../../Downloads/bullet3/src
BULLET_LIB_DIR = /usr/local/lib
GLEW_LIB_DIR = ./../../../../Downloads/glew-2.2.0
FREEGLUT_LIB_DIR = ./../../../../Downloads/freeglut

INC = -I./ \
    -I$(EIGEN_DIR) \
    -I$(BULLET_INC_DIR) \
    -I$(GLEW_INC_DIR) \
    -I$(FREEGLUT_INC_DIR) \
    -I$(BULLET_INC_DIR)

LIBDIRS = -L$(GLEW_LIB_DIR) -L$(FREEGLUT_LIB_DIR) -L$(BULLET_LIB_DIR)
# LIBS = -lGLEW -lGL -lGLU -lglut -lBulletDynamics -lBulletCollision -lLinearMath -lm -lstdc++
LIBS = -L$(BULLET_LIB_DIR) -lGLEW -lGL -lGLU -lglut -lBulletDynamics -lBulletCollision -lLinearMath -lm -lstdc++

CC = clang++
CFLAGS = -std=c++11 -O3 -Wall -fPIC 

SRC_DIRS = util/ \
    util/json/ \
    anim/ \
    sim/ \
    render/ \
    render/lodepng/ \
    scenes/ \
    scenes/arm/ \
    scenes/particle/ \
    scenes/pendulum/

SRC_FILES = $(BIN).cpp DeepMimicCore.cpp $(foreach dir, $(SRC_DIRS), $(wildcard $(dir)*.cpp))
OUT_DIRS = $(addprefix $(OBJ_DIR)/, $(SRC_DIRS))
OBJ = $(addprefix $(OBJ_DIR)/, $(patsubst %.cpp, %.o, $(SRC_FILES)))

default: build

build: $(BIN)

print:
    $(OUT_DIRS)

python: $(OUT_DIRS) $(OBJ)
    swig -c++ -python DeepMimicCore.i
    $(CC) -c -g $(CFLAGS) $(INC) $(LIBS) DeepMimicCore.cpp DeepMimicCore_wrap.cxx -I$(PYTHON_INC)
    $(CC) -shared $(CFLAGS) $(OBJ) $(LIBS) DeepMimicCore_wrap.o -o _DeepMimicCore.so -L$(PYTHON_LIB) $(LIBDIRS)

$(OBJ_DIR)/%.o: %.cpp
    $(CC) -c -g $(CFLAGS) $(INC) -o $@ $<

$(BIN): $(OUT_DIRS) $(OBJ)
    $(CC) -g $(CFLAGS) $(OBJ) $(LIBS) -o $@

$(OUT_DIRS):
    $(MKDIR) $(OUT_DIRS)

clean:
    - rm -f -r $(OUT_DIRS) $(BIN) $(OBJ) $(OBJ_DIR) DeepMimicCore_wrap.cxx _DeepMimicCore.so