Having issues with X64 compiling on Windows.
Using VC14 and X64 as targets.
On the same machine and with same setup X86 versions compile fine.
Using instructions to compile X64 from following link:
https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2
D:\php-sdk2\php-sdk-binary-tools\phpdev\vc14\x64\php-7.1.8-src
$ nmake
Microsoft (R) Program Maintenance Utility Version 14.00.23506.0
Copyright (C) Microsoft Corporation. All rights reserved.
Recreating build dirs
bison.exe --output=Zend/zend_ini_parser.c -v -d -p ini_ Zend/zend_ini_pa
rser.y
bison.exe --output=Zend/zend_language_parser.c -v -d -p zend Zend/zend_l
anguage_parser.y
type ext\pcre\php_pcre.def > D:\php-sdk2\php-sdk-binary-tools\phpdev\vc1
4\x64\php-7.1.8-src\x64\Release_TS\php7ts.dll.def
"" -h win32\ -r D:\php-sdk2\php-sdk-binary-tools\phpdev\vc14\x64\php-7.1
.8-src\x64\Release_TS\ -x D:\php-sdk2\php-sdk-binary-tools\phpdev\vc14\x64\php-7
.1.8-src\x64\Release_TS\ win32\build\wsyslog.mc
'-h' is not recognized as an internal or external command,
operable program or batch file.
NMAKE : fatal error U1077: '"' : return code '0x1'
Stop.
Here is my configure options:
D:\php-sdk2\php-sdk-binary-tools\phpdev\vc14\x64\php-7.1.8-src
$ configure --disable-all --enable-cli --enable-cgi --enable-apache2-4handler
PHP Version: 7.1.8
Had checked Makefile after being generated by configure command. Had found that there is line:
$(MCFILE): win32\build\wsyslog.mc
$(MC) -h win32\ -r $(BUILD_DIR)\ -x $(BUILD_DIR)\ win32\build\wsyslog.mc
and in the Makefile MC is configured by this line:
MC="$(MC)"
It looks like MC is initialized to null ("") and that is way Makefile fails. What is MC and for what is it used?
Related
I am running CMake from under CLion and when identifying CUDA compiler, it apperently uses too long paths, and fails (according to CMakeError.log file):
Compiling the CUDA compiler identification source file "CMakeCUDACompilerId.cu" failed.
Compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/bin/nvcc.exe
Build flags:
Id flags: --keep;--keep-dir;tmp -v
The output was:
1
D:\TESTS\CUDA_CLion\test01\cmake-build-debug\CMakeFiles\3.19.1\CompilerIdCUDA>call "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/HostX64/x64/../../../../../../../VC/Auxiliary/Build/vcvars64.bat"
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.8.2
** Copyright (c) 2020 Microsoft Corporation
**********************************************************************
The input line is too long.
The syntax of the command is incorrect.
#$ C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/HostX64/x64/../../../../../../../VC/Auxiliary/Build/vcvars64.bat
nvcc fatal : Could not set up the environment for Microsoft Visual Studio using 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/HostX64/x64/../../../../../../../VC/Auxiliary/Build/vcvars64.bat'
...
The command it runs is (according to CMake pane of CLion):
D:\Apps\CMake\bin\cmake.exe -DCMAKE_BUILD_TYPE=Debug --debug-output -G "CodeBlocks - NMake Makefiles" D:\TESTS\CUDA_CLion\test01
If I run this command from CLI, it also fails, but with different error:
Compiling the CUDA compiler identification source file "CMakeCUDACompilerId.cu" failed.
Compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.2/bin/nvcc.exe
Build flags:
Id flags: --keep;--keep-dir;tmp -v
The output was:
1
nvcc fatal : Cannot find compiler 'cl.exe' in PATH
And finally, if I just run
cmake ..
from CLI it works: it finds itself Ok with long paths, it finds cl.exe, everything.
The question is: how to fix everything OR how to force CLion just to use only CMake without imagination?
Did your script invoke vcvarsall.bat or vcvars64.bat multiple times?
It could be solved by reduce them
I am trying to build the source of CURA. I followed the instructions but got error as below:
D:\work\cura-build-environment-master\build>nmake -f ALL_BUILD.vcxproj
Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation. All rights reserved.
ALL_BUILD.vcxproj(1) : fatal error U1036: syntax error : too many names to left of '='
Stop.
I have used CMAKE application and since Visual Studio was installed, it make files with extension of .vcxproj instead of makefiles. So I have used this command:
cmake -DCMAKE_INSTALL_PREFIX=../install_dir -DBUILD_STATIC=ON -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles" ..
from terminal in build folder and it worked. I created makefile for nmake.
Then nmake worked.
Following this post, I'm trying to compile Elmer FEM on Windows using the MinGW compilers. However when running the
cmake -DCMAKE_C_COMPILER=C:\\MinGW\\bin\\gcc.exe -DCMAKE_CXX_COMPILER=C:\\MinGW\\bin\\g++.exe -DCMAKE_Fortran_COMPILER=C:\\MinGW\\bin\\gfortran.exe ..
command in the build folder I get the error:
-- Selecting Windows SDK version 10.0.17134.0 to target Windows 10.0.18363.
-- The Fortran compiler identification is unknown
-- Check for working Fortran compiler: C:\MinGW\bin\gfortran.exe
-- Check for working Fortran compiler: C:\MinGW\bin\gfortran.exe -- broken
CMake Error at C:/Program Files/CMake/share/cmake-3.16/Modules/CMakeTestFortranCompiler.cmake:45 (message):
The Fortran compiler
"C:\MinGW\bin\gfortran.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/foobar/Desktop/elmer/elmerfem/build/CMakeFiles/CMakeTmp
Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/devenv.com CMAKE_TRY_COMPILE.sln /build Debug /project cmTC_8d573 &&
Microsoft Visual Studio 2017 Version 15.0.28010.2050.
Copyright (C) Microsoft Corp. All rights reserved.
Some errors occurred during migration. For more information, see the migration report:
C:\Users\foobar\Desktop\elmer\elmerfem\build\CMakeFiles\CMakeTmp\UpgradeLog.htm
Invalid project
from here I tried adding the
set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
to the CmakeLists.txt file, running the cmd as admin from here, and from here tried uninstalling (from Chocolatey) and re-installing MinGW from the original website with no avail. I would appreciate it if you could help me know what is the problem and how I can solve it.
P.S. To solve the above issue one shoudl use the command:
cmake -DCMAKE_C_COMPILER=C:/MinGW/bin/gcc.exe -DCMAKE_CXX_COMPILER=C:/MinGW/bin/g++.exe -DCMAKE_Fortran_COMPILER=C:/MinGW/bin/gfortran.exe -DCMAKE_MAKE_PROGRAM=C:/MinGW/bin/mingw32-make.exe .. -G "MinGW Makefiles"
But then there is the missing BLAS issue. I'm trying to solve. this using MSYS2
To build Elmer on Windows, you need MSYS as you pointed out (the Visual Studio error about an invalid project is because an Intel Fortran Visual Studio project was generated when running in cmd.exe but the Intel Fortran Visual Studio extension is not installed). Use pacman to install Elmer's MSYS dependencies: cmake, openblas, qt5, qwt-qt5, and nsis (as of commit 442ea2000f87). See this script for all the commands required to install these dependencies. You can also run that script in MSYS to install all the required dependencies, build Elmer, and create a local Elmer install directory with executable Elmer binaries.
I haven't a clue when it comes to building makefiles - I am trying to build luafilesystem in Windows 7 x86 for use with Lua for Windows. I have scoured the internet for tutorials but I just can't figure it out. I got as far as to run NMAKE in the Developer Command Prompt but I received the following error:
C:\Users\Me\Desktop\luafilesystem-master\luafilesystem-master>nmake -f Makefile.win
Microsoft (R) Program Maintenance Utility Version 12.00.21005.1
Copyright (C) Microsoft Corporation. All rights reserved.
cl /c /Fosrc\lfs.obj /MD /O2 /I"c:\lua5.1\include" src\lfs.c
Microsoft (R) C/C++ Optimizing Compiler Version 18.00.30723 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
lfs.c
src\lfs.c(63) : fatal error C1083: Cannot open include file: 'lua.h': No such file or directory
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
I'm not sure what I'm doing wrong. There was no lua.h in the set of files I downloaded directly from the official LuaFileSystem repository.
All I want is to install lfs to use in lua. If you can't figure out what I'm doing wrong but happen to know an easier way, please share. I hope I've provided enough information. Thanks.
You need to have the Lua interpreter you are compiling against to be compiled and available on your computer to access its header files (lua.h and few others) and Lua library/dll files. After you compile the right version of Lua interpreter you need (whether Lua 5.1 or Lua 5.2), set the environmental variables (or update the paths in the make file) LUA_LIBDIR, LUA_INC and LUA_LIB to point to your lua-folder, lua-folder\src, and the lua lib correspondingly.
I am having problems running verify_tools to make a Wireshark build on Windows. The makefile fails with the following errors about not being able to find a file.
C:\Development\wireshark>nmake -f Makefile.nmake verify_tools
Microsoft (R) Program Maintenance Utility Version 10.00.40219.01
Copyright (C) Microsoft Corporation. All rights reserved.
tools/win64-setup.sh: line 12: /cygdrive/c/Development/wireshark/tools/win-setup: No such file or directory
tools/win64-setup.sh: line 12: exec: /cygdrive/c/Development/wireshark/tools/win: cannot execute: No such file or directory
tools/win64-setup.sh: line 12: /cygdrive/c/Development/wireshark/tools/win-setup: No such file or directory
tools/win64-setup.sh: line 12: exec: /cygdrive/c/Development/wireshark/tools/win: cannot execute: No such file or directory
NMAKE : fatal error U1077: 'C:\Users\indiv\apps\cygwin\bin\bash.EXE' : return code '0x7e'
Stop.
To debug, I changed win64-setup.sh and made it print WIN_SETUP.
echo WIN_SETUP: [$WIN_SETUP]
exec $WIN_SETUP $#
The results were bizarre. Possibly because of some end-of-line issue.
C:\Development\wireshark>nmake -f Makefile.nmake verify_tools
Microsoft (R) Program Maintenance Utility Version 10.00.40219.01
Copyright (C) Microsoft Corporation. All rights reserved.
]IN_SETUP: [tools/win-setup.sh
How can I fix or work around this problem?
The Wireshark build relies on all its supporting utilities coming from cygwin, except for cl, link, and nmake. Your path is set up such that some supporting utilities are coming from elsewhere in your environment. Like from an install of gnuwin32 or something.
For explanation purposes, let's say the variable CYGWIN is set to your cygwin path, like c:\cygwin\bin.
You are probably doing something like this, as suggested by the Wireshark wiki:
set PATH=%PATH%;%CYGWIN%
call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" /Release /x64
Instead of doing it that way, move cygwin earlier in the path search order so that executables always come from there. Then set up your Windows build environment so that Microsoft's link comes before cygwin's link.
set PATH=%CYGWIN%;%PATH%
call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" /Release /x64
Don't forget when you make these changes to restart your shell to wipe the old environment completely because SetEnv.cmd may have cached the old environment, which will prevent you from changing %PATH%.
And then you get this instead when you run the verify_tools rule:
c:\Development\wireshark>nmake -f Makefile.nmake verify_tools
Microsoft (R) Program Maintenance Utility Version 10.00.40219.01
Copyright (C) Microsoft Corporation. All rights reserved.
Checking for required applications:
cl: /cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/Bin/cl
link: /cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/Bin/link
nmake: /cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/Bin/nmake
bash: /usr/bin/bash
bison: /usr/bin/bison
flex: /usr/bin/flex
env: /usr/bin/env
grep: /usr/bin/grep
/usr/bin/find: /usr/bin/find
peflags: /usr/bin/peflags
perl: /usr/bin/perl
sed: /usr/bin/sed
unzip: /usr/bin/unzip
wget: /usr/bin/wget