Skip to content

Window compilation issue. LNK1181 errorΒ #685

Open
@spyroot

Description

@spyroot

Describe the bug
A clear and concise description of what the bug is.

I think there is some issue when compiling under the window

I'm using the MSVC console.

LINK : warning LNK4044: unrecognized option '/fopenmp'; ignored
LINK : fatal error LNK1181: cannot open input file 'mujoco210.lib'
error: command 'D:\dev\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\link.exe' failed with exit code 1181

To Reproduce
Steps to reproduce the behavior.

Expected behavior
A clear and concise description of what you expected to happen.

Open VC Console.
conda activate env_name

set MUJOCO_PY_MUJOCO_PATH=C:\Users\X.mujoco\mujoco210
set PATH=C:\Users\X.mujoco\mujoco210;%PATH%

clone repo
python setup.py build

LINK : warning LNK4044: unrecognized option '/fopenmp'; ignored
LINK : fatal error LNK1181: cannot open input file 'mujoco210.lib'
error: command 'D:\dev\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\link.exe' failed with exit code 1181

Error Messages
Including more/longer error messages gives us more information to work with.

(X) c:\mujoco-py>python setup.py build
running build
Removing old mujoco_py cext c:\mujoco-py\mujoco_py\generated\cymj_2.1.2.14_38_windowsextensionbuilder_38.so
running build_ext
building 'mujoco_py.cymj' extension
cl : Command line warning D9025 : overriding '/W3' with '/w'
cl : Command line warning D9002 : ignoring unknown option '-fopenmp'
dummyshim.c
cl : Command line warning D9025 : overriding '/W3' with '/w'
cl : Command line warning D9002 : ignoring unknown option '-fopenmp'
cymj.c
C:\Users\X\anaconda3\envs\X\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
LINK : warning LNK4044: unrecognized option '/fopenmp'; ignored
LINK : fatal error LNK1181: cannot open input file 'mujoco210.lib'
error: command 'D:\dev\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\link.exe' failed with exit code 1181

Desktop (please complete the following information):

  • OS: [e.g. Win32]
  • Python Version [e.g. 3.8]
  • Mujoco Version [e.g. 2.1.1]
  • mujoco-py version [e.g. upstream git clone]

Environment

  • output of: echo $LD_LIBRARY_PATH
  • output of: echo $HOME
  • output of: echo $USER

VC related

VCIDEInstallDir=D:\dev\Common7\IDE\VC
VCINSTALLDIR=D:\dev\VC
VCToolsInstallDir=D:\dev\VC\Tools\MSVC\14.29.30133
VCToolsRedistDir=D:\dev\VC\Redist\MSVC\14.29.30133
VCToolsVersion=14.29.30133
VisualStudioVersion=16.0
VS160COMNTOOLS=D:\dev\Common7\Tools
VSCMD_ARG_app_plat=Desktop
VSCMD_ARG_HOST_ARCH=x86
VSCMD_ARG_TGT_ARCH=x86
VSCMD_VER=16.11.10
VSINSTALLDIR=D:\dev\

Path=C:\Users\X.mujoco\mujoco210;
MUJOCO_PY_MUJOCO_PATH=C:\Users\X.mujoco\mujoco210

Conda and the rest

CommandPromptType=Native
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=X
ComSpec=C:\WINDOWS\system32\cmd.exe
CONDA_DEFAULT_ENV=X
CONDA_EXE=C:\Users\X\anaconda3\Scripts\conda.exe
CONDA_PREFIX=C:\Users\X\anaconda3\envs\X
CONDA_PROMPT_MODIFIER=(X)
CONDA_PYTHON_EXE=C:\Users\X\anaconda3\python.exe
CONDA_SHLVL=1

Additional context
Add any other context about the problem here.

I think somewhere the path to the lib file doesn't resolve correctly or maybe something different.

LINK : warning LNK4044: unrecognized option '/fopenmp'; ignored
LINK : fatal error LNK1181: cannot open input file 'mujoco210.lib'
error: command 'D:\dev\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\link.exe' failed with exit code 1181

First I think for VC it must /openmp
https://docs.microsoft.com/en-us/cpp/build/reference/openmp-enable-openmp-2-0-support?view=msvc-170
But it was ignored anyway.

So the root cause
LINK: fatal error LNK1181: cannot open input file 'mujoco210.lib'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions