performancecopilot / pcp

Performance Co-Pilot
https://pcp.io
Other
949 stars 232 forks source link

Cannot compile for Windows using mingw64 on Fedora 26 #352

Open JasonatCU opened 6 years ago

JasonatCU commented 6 years ago

I'm trying to compile the .exe's for Windows using Fedora as mentioned in the Install.md. I ran the qa/admin/check-vm to get the dependencies required for build, though I am missing a few that I'll list below. When I run "./Makepkgs --verbose --target mingw64" from a fresh Fedora 26 VM, I get lots of warnings, then finally an error ending with "fatal error: sys/wait.h: No such file or directory." This is included from exec.c. I tried removing the include out of curiosity from exec.c and as expected I got more errors than I could deal with. Any suggestions? I am new to the open source scene, so please bear with me while I learn this. Thanks for your help.

Edit**

Also forgot to mention, that I installed these packages as well, as mentioned in the Install.md file. mingw64-qt5-qttools-tools mingw64-qt5-qtbase-devel mingw64-pkg-config mingw64-readline mingw64-xz-libs

Edit Just wanted to note, if I run "./Makepkgs --verbose" without specifying the target mingw64, then it compiles the rpms without issue at all.

Missing dependencies: Missing: Slurm::Hostlist [perl-Slurm-Hostlist or 'perl(Slurm::Hostlist)'] Missing: Spreadsheet::Read [perl-Spreadsheet-Read or 'perl(Spreadsheet::Read)' or from cpan (QA optional)] Missing: Spreadsheet::ReadSXC [perl-Spreadsheet-ReadSXC or 'perl(Spreadsheet::ReadSXC)' or from cpan (QA optional)] Missing: /usr/lib*/sasl2/libplain.so [cyrus-sasl-plain (QA optional)] Missing: DBI:: [perl-DBI or 'perl(DBI)' (postgresql QA optional)] Missing: DBD::Pg [perl-DBD-Pg or 'perl(DBD::Pg)' (postgresql QA optional)] Missing: DBD::mysql [perl-DBD-mysql or 'perl(DBD::mysql)' (mysql QA optional)] Missing: memcached [memcached (memcache QA optional)] Missing: zabbix_agentd [zabbix-agent (zabbix QA optional)] Missing: mysql [mysql or community-mysql (mysql QA optional)] Missing: psql [postgresql (postgresql QA optional)] Missing: mkfs.gfs2 [gfs2-utils (gfs2 QA optional)] Missing: docker [docker-io (QA optional)] Missing: qtchooser [qtchooser (build optional)] Missing: uic [? (build optional)] Unexpected host(1) output: Host 37fa70cd382a not found: 3(NXDOMAIN) ... cannot get ip addr and netmask Please ignore Warnings from _getnetworkaddr unless you wish to run the full PCP QA suite. Error: /root is not searchable by user "pcp"

Last several lines of the ./Makepkgs --verbose --target mingw64 connectlocal.c:217:35: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'int' [-Wformat=] pmsprintf(name, sizeof(name), "%" FMT_PID, getpid()); ^~~ ~~~~ In file included from ../../../src/include/pcp/pmapi.h:21:0, from connectlocal.c:45: ../../../src/include/pcp/platform_defs.h:34:19: note: format string is defined here

define FMT_PID "ld"

./fix_derive_parser_y bison -y -d -b basename derive_parser.y .y derive_parser.y x86_64-w64-mingw32-gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -fno-strict-aliasing -DPCP_INTERNAL '-DEXEC_SUFFIX=".exe"' '-DDSO_SUFFIX="dll"' -Wall -O2 -g -DPCP_VERSION=\"3.12.2\" -I../../../src/include -I../../../src/include/pcp -c -o derive_fetch.o derive_fetch.c x86_64-w64-mingw32-gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -fno-strict-aliasing -DPCP_INTERNAL '-DEXEC_SUFFIX=".exe"' '-DDSO_SUFFIX="dll"' -Wall -O2 -g -DPCP_VERSION=\"3.12.2\" -I../../../src/include -I../../../src/include/pcp -c -o events.o events.c events.c: In function 'dump_count': events.c:35:58: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'long long unsigned int' [-Wformat=] fprintf(f, "Error: bad len (smaller than minimum size %lu)\n", ~~^ %I64u events.c:35:58: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'long long unsigned int' [-Wformat=] fprintf(f, "Error: bad len (smaller than minimum size %lu)\n", ~~^ %I64u x86_64-w64-mingw32-gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -fno-strict-aliasing -DPCP_INTERNAL '-DEXEC_SUFFIX=".exe"' '-DDSO_SUFFIX="dll"' -Wall -O2 -g -DPCP_VERSION=\"3.12.2\" -I../../../src/include -I../../../src/include/pcp -c -o lock.o lock.c x86_64-w64-mingw32-gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -fno-strict-aliasing -DPCP_INTERNAL '-DEXEC_SUFFIX=".exe"' '-DDSO_SUFFIX="dll"' -Wall -O2 -g -DPCP_VERSION=\"3.12.2\" -I../../../src/include -I../../../src/include/pcp -c -o hash.o hash.c x86_64-w64-mingw32-gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -fno-strict-aliasing -DPCP_INTERNAL '-DEXEC_SUFFIX=".exe"' '-DDSO_SUFFIX="dll"' -Wall -O2 -g -DPCP_VERSION=\"3.12.2\" -I../../../src/include -I../../../src/include/pcp -c -o fault.o fault.c x86_64-w64-mingw32-gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -fno-strict-aliasing -DPCP_INTERNAL '-DEXEC_SUFFIX=".exe"' '-DDSO_SUFFIX="dll"' -Wall -O2 -g -DPCP_VERSION=\"3.12.2\" -I../../../src/include -I../../../src/include/pcp -c -o access.o access.c access.c: In function 'pmAccDumpUsers': access.c:1809:26: warning: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'pmGroupID {aka struct _SID}' [-Wformat=] fprintf(stream, "%c%u(%s)", i ? ',' : ' ', up->groupids[i], ~^ ~~~ access.c:1809:26: warning: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'pmGroupID {aka struct _SID}' [-Wformat=] access.c: In function 'pmAccDumpGroups': access.c:1868:37: warning: format '%d' expects argument of type 'int', but argument 4 has type 'pmGroupID {aka struct _SID}' [-Wformat=] pmsprintf(buf, sizeof(buf), "%6d", gp->groupid); ^ ~~~~~ access.c:1876:26: warning: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'pmUserID {aka struct _SID}' [-Wformat=] fprintf(stream, "%c%u(%s)", i ? ',' : ' ', gp->userids[i], ~ ~~~~~~ access.c:1876:26: warning: format '%u' expects argument of type 'unsigned int', but argument 4 has type '__pmUserID {aka struct _SID}' [-Wformat=] x86_64-w64-mingw32-gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -fno-strict-aliasing -DPCP_INTERNAL '-DEXEC_SUFFIX=".exe"' '-DDSO_SUFFIX="dll"' -Wall -O2 -g -DPCP_VERSION=\"3.12.2\" -I../../../src/include -I../../../src/include/pcp -c -o getopt.o getopt.c x86_64-w64-mingw32-gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -fno-strict-aliasing -DPCP_INTERNAL '-DEXEC_SUFFIX=".exe"' '-DDSO_SUFFIX="dll"' -Wall -O2 -g -DPCP_VERSION=\"3.12.2\" -I../../../src/include -I../../../src/include/pcp -c -o probe.o probe.c x86_64-w64-mingw32-gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -fno-strict-aliasing -DPCP_INTERNAL '-DEXEC_SUFFIX=".exe"' '-DDSO_SUFFIX="dll"' -Wall -O2 -g -DPCP_VERSION=\"3.12.2\" -I../../../src/include -I../../../src/include/pcp -c -o io.o io.c x86_64-w64-mingw32-gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -fno-strict-aliasing -DPCP_INTERNAL '-DEXEC_SUFFIX=".exe"' '-DDSO_SUFFIX="dll"' -Wall -O2 -g -DPCP_VERSION=\"3.12.2\" -I../../../src/include -I../../../src/include/pcp -c -o io_stdio.o io_stdio.c x86_64-w64-mingw32-gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -fno-strict-aliasing -DPCP_INTERNAL '-DEXEC_SUFFIX=".exe"' '-DDSO_SUFFIX="dll"' -Wall -O2 -g -DPCP_VERSION=\"3.12.2\" -I../../../src/include -I../../../src/include/pcp -c -o io_xz.o io_xz.c x86_64-w64-mingw32-gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -fno-strict-aliasing -DPCP_INTERNAL '-DEXEC_SUFFIX=".exe"' '-DDSO_SUFFIX="dll"' -Wall -O2 -g -DPCP_VERSION=\"3.12.2\" -I../../../src/include -I../../../src/include/pcp -c -o exec.o exec.c exec.c:33:10: fatal error: sys/wait.h: No such file or directory

include <sys/wait.h>

      ~~~~~~~~~~~

compilation terminated. make[3]: [: exec.o] Error 1 make[2]: [GNUmakefile:24: default] Error 2 make[1]: [GNUmakefile:129: default_pcp] Error 2 make[1]: Leaving directory '/root/pcp/pcp-3.12.2/src' make: [GNUmakefile:49: default_pcp] Error 2

kmcdonell commented 6 years ago

@JasonatCU ... I suspect it is a very long time since anyone tried to compile PCP for Windows ... there are a number of warnings that need to be fixed before we get the fatal issue ... since I broke the latter I'll fix that and clean up anything else that is obvious bit-rot since PCP was last built for Windows.

natoscott commented 6 years ago

@kenj the warnings have been around forever - most recent build was a month or so ago, so I think we should be building OK again with those pmProcessExec/Pipe updates.

commit 79f2e985cf6ad51660d0eebfd6ff1fa789409e61 Author: Nathan Scott nathans@redhat.com Date: Wed Aug 23 11:06:33 2017 +1000

build: small fixes for the Windows build, and use Qt5
kmcdonell commented 6 years ago

@natoscott the warnings are not all benign it appears to me ... I'll try to fix some of 'em on the way to sorting out what to do in exec.c

JasonatCU commented 6 years ago

Thanks guys! I look forward to trying this on Windows. If I can help in any way, I will give it my best shot.

kmcdonell commented 6 years ago

@JasonatCU when commit 4bdf563 makes it from my tree into the official tree, you should see Makepkgs run to completion for your cross-compilation. @natoscott is there a recipe for installing and testing on a Windows platform, now that we no longer build installable packages for Windows?

natoscott commented 6 years ago

@kmcdonell there is no recipe. Its definitely an area where work is needed - individual commands can be run by setting %PATH to add libpcp (and friends) though.