Please help me build the CopperSpice library!

Discuss issues related to installing or building
Post Reply
Navadvipa Chandra d
Posts: 7
Joined: Sun Apr 19 2020 7:02 pm

Please help me build the CopperSpice library!

Post by Navadvipa Chandra d »

Hare Krishna, All!

1. Windows 10 64 bit
2. CMake 3.17.1 in C:\CMake
3. MinGW64 in C:\msys64\mingw64
4. Clone https://github.com/copperspice/copperspice into C:\copperspice
5. Install Ninja into C:\Ninja
6. Add C:\CMake and C:\Ninja into Path

7. In CMakeLists.txt I add this rows

set(CMAKE_CXX_FLAGS "-std=c++2a")
set(CMAKE_INSTALL_PREFIX "C:/copperspice")
set(CMAKE_C_COMPILER "C:/msys64/mingw64/bin/gcc.exe")
set(CMAKE_CXX_COMPILER "C:/msys64/mingw64/bin/g++.exe")

after rows
# support using rpath on Mac OS X
cmake_policy(SET CMP0042 NEW)

7. I try do:
cd C:\copperspice
cmake CMakeLists.txt

Result : *********************************************************
C:\copperspice>cmake CMakeLists.txt
-- Building for: NMake Makefiles
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: C:/msys64/mingw64/bin/gcc.exe
CMake Error: Generator: execution of make failed. Make command was: nmake /nologo cmTC_3c880\fast &&
-- Check for working C compiler: C:/msys64/mingw64/bin/gcc.exe - broken
CMake Error at C:/CMake/share/cmake-3.17/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler

"C:/msys64/mingw64/bin/gcc.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: C:/copperspice/CMakeFiles/CMakeTmp

Run Build Command(s):nmake /nologo cmTC_3c880\fast && Не удается найти указанный файл
Generator: execution of make failed. Make command was: nmake /nologo cmTC_3c880\fast &&




CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:18 (project)


-- Configuring incomplete, errors occurred!
See also "C:/copperspice/CMakeFiles/CMakeOutput.log".
See also "C:/copperspice/CMakeFiles/CMakeError.log".
end result *****************************************************

See also "C:/copperspice/CMakeFiles/CMakeError.log"
*****************************************************************
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: C:/msys64/mingw64/bin/gcc.exe
Build flags:
Id flags:

The output was:
1


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: C:/msys64/mingw64/bin/gcc.exe
Build flags:
Id flags: -c

The output was:
1


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: C:/msys64/mingw64/bin/gcc.exe
Build flags:
Id flags: -Aa

The output was:
1


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: C:/msys64/mingw64/bin/gcc.exe
Build flags:
Id flags: -D__CLASSIC_C__

The output was:
1


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: C:/msys64/mingw64/bin/gcc.exe
Build flags:
Id flags: --target=arm-arm-none-eabi;-mcpu=cortex-m3

The output was:
1
gcc.exe: warning: '-mcpu=' is deprecated; use '-mtune=' or '-march=' instead
gcc.exe: error: unrecognized command line option '--target=arm-arm-none-eabi'


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: C:/msys64/mingw64/bin/gcc.exe
Build flags:
Id flags:

The output was:
1


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: C:/msys64/mingw64/bin/gcc.exe
Build flags:
Id flags: -c

The output was:
1


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: C:/msys64/mingw64/bin/gcc.exe
Build flags:
Id flags: -Aa

The output was:
1


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: C:/msys64/mingw64/bin/gcc.exe
Build flags:
Id flags: -D__CLASSIC_C__

The output was:
1


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: C:/msys64/mingw64/bin/gcc.exe
Build flags:
Id flags: --target=arm-arm-none-eabi;-mcpu=cortex-m3

The output was:
1
gcc.exe: warning: '-mcpu=' is deprecated; use '-mtune=' or '-march=' instead
gcc.exe: error: unrecognized command line option '--target=arm-arm-none-eabi'


Checking whether the C compiler is IAR using "" did not match "IAR .+ Compiler":
gcc.exe: fatal error: no input files
compilation terminated.
Checking whether the C compiler is IAR using "" did not match "IAR .+ Compiler":
gcc.exe: fatal error: no input files
compilation terminated.
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: C:/msys64/mingw64/bin/g++.exe
Build flags: -std=c++2a
Id flags:

The output was:
1


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: C:/msys64/mingw64/bin/g++.exe
Build flags: -std=c++2a
Id flags: -c

The output was:
1


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: C:/msys64/mingw64/bin/g++.exe
Build flags: -std=c++2a
Id flags: --c++

The output was:
1
g++.exe: error: unrecognized command line option '--c++'


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: C:/msys64/mingw64/bin/g++.exe
Build flags: -std=c++2a
Id flags: --ec++

The output was:
1
g++.exe: error: unrecognized command line option '--ec++'; did you mean '-Weffc++'?


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: C:/msys64/mingw64/bin/g++.exe
Build flags: -std=c++2a
Id flags: --target=arm-arm-none-eabi;-mcpu=cortex-m3

The output was:
1
g++.exe: warning: '-mcpu=' is deprecated; use '-mtune=' or '-march=' instead
g++.exe: error: unrecognized command line option '--target=arm-arm-none-eabi'


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: C:/msys64/mingw64/bin/g++.exe
Build flags:
Id flags:

The output was:
1


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: C:/msys64/mingw64/bin/g++.exe
Build flags:
Id flags: -c

The output was:
1


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: C:/msys64/mingw64/bin/g++.exe
Build flags:
Id flags: --c++

The output was:
1
g++.exe: error: unrecognized command line option '--c++'


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: C:/msys64/mingw64/bin/g++.exe
Build flags:
Id flags: --ec++

The output was:
1
g++.exe: error: unrecognized command line option '--ec++'; did you mean '-Weffc++'?


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: C:/msys64/mingw64/bin/g++.exe
Build flags:
Id flags: --target=arm-arm-none-eabi;-mcpu=cortex-m3

The output was:
1
g++.exe: warning: '-mcpu=' is deprecated; use '-mtune=' or '-march=' instead
g++.exe: error: unrecognized command line option '--target=arm-arm-none-eabi'


Checking whether the CXX compiler is IAR using "" did not match "IAR .+ Compiler":
g++.exe: fatal error: no input files
compilation terminated.
Checking whether the CXX compiler is IAR using "" did not match "IAR .+ Compiler":
g++.exe: fatal error: no input files
compilation terminated.
Determining if the C compiler works failed with the following output:
Change Dir: C:/copperspice/CMakeFiles/CMakeTmp

Run Build Command(s):nmake /nologo cmTC_3c880\fast && Не удается найти указанный файл
Generator: execution of make failed. Make command was: nmake /nologo cmTC_3c880\fast &&
****************************************************************

Please help me build the CopperSpice library!

Hare Krishna!
Thank you!

With best regards, Navadvipa Chandra das.

ansel
Posts: 99
Joined: Fri Apr 10 2015 8:23 am

Re: Please help me build the CopperSpice library!

Post by ansel »

7. In CMakeLists.txt I add this rows
This is not the ideal way to adjust your build environment since these changes will be lost if you move to a new version of CopperSpice.

Here is a link to our overview documentation for the Windows build process: https://www.copperspice.com/docs/cs_overview/requirements-win.html

On that page, please note that you should be adding your MinGW directory to the path, as well as CMake and Ninja. Building CopperSpice on MinGW works great, please take a look at the Build Overview page: https://www.copperspice.com/docs/cs_overview/build-overview.html

Please ensure that you are using the -G "Ninja" option to CMake, since this is required for MinGW. Often several command line arguments are needed when invoking CMake. We suggest creating a script as shown in our Build Overview documentation to avoid having to type the command repeatedly.

Can you let us know what version of MinGW you are using? Please let us know how it goes and we will continue to support you in building CS.
Ansel Sermersheim
CopperSpice Cofounder

Navadvipa Chandra d
Posts: 7
Joined: Sun Apr 19 2020 7:02 pm

Re: Please help me build the CopperSpice library!

Post by Navadvipa Chandra d »

Hare Krishna Ansel and all!
Thank You for reply.
I create C:\cs_build and C:\cs_lib and add in Path C:/msys64/mingw64/bin
*************
C:\cs_build>cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=C:/cs_lib C:/copperspice
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: C:/msys64/mingw64/bin/cc.exe
-- Check for working C compiler: C:/msys64/mingw64/bin/cc.exe - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/msys64/mingw64/bin/c++.exe
-- Check for working CXX compiler: C:/msys64/mingw64/bin/c++.exe - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for dlfcn.h
-- Looking for dlfcn.h - not found
-- Looking for dirent.h
-- Looking for dirent.h - found
-- Looking for features.h
-- Looking for features.h - not found
-- Looking for fcntl.h
-- Looking for fcntl.h - found
-- Looking for grp.h
-- Looking for grp.h - not found
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for libpq-fe.h
-- Looking for libpq-fe.h - not found
-- Looking for memory.h
-- Looking for memory.h - found
-- Looking for pg_config.h
-- Looking for pg_config.h - not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_np.h
-- Looking for pthread_np.h - not found
-- Looking for pwd.h
-- Looking for pwd.h - not found
-- Looking for signal.h
-- Looking for signal.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stdlib.h
-- Looking for stdlib.h - found
-- Looking for strings.h
-- Looking for strings.h - found
-- Looking for string.h
-- Looking for string.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for cups/cups.h
-- Looking for cups/cups.h - not found
-- Looking for mysql/mysql.h
-- Looking for mysql/mysql.h - not found
-- Looking for net/if.h
-- Looking for net/if.h - not found
-- Looking for netinet/in.h
-- Looking for netinet/in.h - not found
-- Looking for sys/eventfd.h
-- Looking for sys/eventfd.h - not found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for sys/ioctl.h
-- Looking for sys/ioctl.h - not found
-- Looking for sys/ipc.h
-- Looking for sys/ipc.h - not found
-- Looking for sys/time.h
-- Looking for sys/time.h - found
-- Looking for sys/shm.h
-- Looking for sys/shm.h - not found
-- Looking for sys/socket.h
-- Looking for sys/socket.h - not found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/wait.h
-- Looking for sys/wait.h - not found
-- Looking for sys/param.h
-- Looking for sys/param.h - found
-- Looking for 8 include files dlfcn.h, ..., float.h
-- Looking for 8 include files dlfcn.h, ..., float.h - not found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of size_t
-- Check size of size_t - done
-- Checking for 64-bit off_t
-- Performing Test FILE64_OK
-- Performing Test FILE64_OK - Failed
-- Checking for 64-bit off_t - not present
-- Checking for fseeko/ftello
-- Performing Test FSEEKO_COMPILE_OK 9
-- Performing Test FSEEKO_COMPILE_OK - Failed
-- Checking for fseeko/ftello - not found
-- Large File support - not found

Configuring CMake for CopperSpice


Search for required Packages

-- Found OpenSSL: C:/msys64/mingw64/lib/libcrypto.dll.a (found suitable version "1.1.1e", minimum required is "1.0")
-- Found ZLIB: C:/msys64/mingw64/lib/libz.dll.a (found version "1.2.11")
-- Could NOT find PostgreSQL (missing: PostgreSQL_LIBRARY PostgreSQL_INCLUDE_DIR PostgreSQL_TYPE_INCLUDE_DIR)
-- Found MySQL: C:/Program Files/MariaDB 10.3/include/mysql


Enabled CopperSpice libraries

* Core Gui Multimedia Network OpenGL Script Sql Svg WebKit Xml XmlPatterns

-- The following packages have been found:

* OpenSSL (required version >= 1.0), Support for SSL and TLS, <https://openssl.org>
Required for HTTPS support
* ZLIB, Compression Library, <https://zlib.net>
Required for compression support
* MySQL, Popular open source database, <http://www.mysql.com>
Required for MySQL database support

-- The following packages have not been found:

* PostgreSQL, Popular open source database, <http://www.postgresql.org>
Required for PostgreSQL database support


CopperSpice configured to run on: Windows 64 bit, Release Mode
CopperSpice will be built in: C:/cs_build
CopperSpice will be installed in: C:/cs_lib


-- Configuring done
-- Generating done
-- Build files have been written to: C:/cs_build
****************************

C:\cs_build\bin is empty
C:\cs_lib is empty

C:\msys64\mingw64>g++ --version
g++.exe (Rev2, Built by MSYS2 project) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

With best regards Navadvipa Chandra das.

barbara
Posts: 202
Joined: Sat Apr 04 2015 2:32 am

Re: Please help me build the CopperSpice library!

Post by barbara »

C:\cs_build>cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=C:/cs_lib C:/copperspice

C:\cs_build\bin is empty
C:\cs_lib is empty
It appears that your question is now about, why are the BUILD and LIB folders empty. The cmake command you ran is perfect and this worked. Congratulations, you have configured the project!

If you have a look at our CS Overview Documentation this was "Step 1 Configure".
( https://www.copperspice.com/docs/cs_overview/build-overview.html )

The next step is documented under "Step 2 Compile". CopperSpice is compiled and linked by running the following command in the cs_build directory. You do this by typing ninja at the command prompt. The libraries will be located in c:\cs_build\bin once this step has run.

To install CopperSpice run the following command in the cs_build directory: ninja install. This will copy all of the necessary files to c:\cs_lib.

You may want to check out the code listing at the bottom of the "build-overview.html" page. It shows a listing which contains all of these commands in one script.

If you have more questions, feel free to ask.

Barbara

Navadvipa Chandra d
Posts: 7
Joined: Sun Apr 19 2020 7:02 pm

Re: Please help me build the CopperSpice library!

Post by Navadvipa Chandra d »

Hare Krishna, Barbara and All!
Thank You for reply!

The ninja command is filling up well, but my computer is too slow. Memory goes into the Swap file and wild brakes start. I have 4 GB of RAM and had a 10.5 GB Swap file-memory was not enough. Made a 21 GB Swap file-compiles, but too slow. Try again. It seems to me that the Clang compiler would handle the task on low memory well, but cmake is not configured to use clang. Can I use clang?

Also a question about Postgresql and the header file 'C:/Program Files/PostgreSQL/12/include/pthread.h' . What should I do?


****************
Search for required Packages

-- Found OpenSSL: C:/msys64/mingw64/lib/libcrypto.dll.a (found suitable version "1.1.1g", minimum required is "1.0")
-- Found ZLIB: C:/msys64/mingw64/lib/libz.dll.a (found version "1.2.11")
-- Found PostgreSQL: C:/Program Files/PostgreSQL/12/lib/libpq.lib (found version "12.2")
CMake Warning at CMakeLists.txt:272 (message):


CMake Warning at CMakeLists.txt:273 (message):
------------------------------------------------------------


CMake Warning at CMakeLists.txt:274 (message):
WARNING WARNING WARNING


CMake Warning at CMakeLists.txt:275 (message):
The 'C:/Program Files/PostgreSQL/12/include' directory contains a file
called pthread.h


CMake Warning at CMakeLists.txt:276 (message):


CMake Warning at CMakeLists.txt:277 (message):
A conflict exists between pthread.h and the standard library


CMake Warning at CMakeLists.txt:278 (message):
Rename or remove pthread.h in order to build the CsSqlPsql plugin


CMake Warning at CMakeLists.txt:279 (message):
------------------------------------------------------------


CMake Warning at CMakeLists.txt:280 (message):


-- PostgreSQL client library was found, plugin will not be built
--
-- Found MySQL: C:/Program Files/MariaDB 10.3/include/mysql
*******************************

In any case, I decided to uninstall Windows 10 and install Linux. Let's see how Linux will cope with compiling CopperSpice with a small amount of RAM.

Hare Krishna!
Thank You!

With best regards, Navadvipa Chandra das.

barbara
Posts: 202
Joined: Sat Apr 04 2015 2:32 am

Re: Please help me build the CopperSpice library!

Post by barbara »

I have 4 GB of RAM and had a 10.5 GB Swap file-memory was not enough.
To compile most libraries like CopperSpice you simply need more computer memory. I am running a Windows 10 system with 64 GB of memory and I use a -j8 when compiling. I might trying forcing ninja to run a single job at a time using a -j1.

You simply do not have enough memory. You can try reconfiguring and using clang however I doubt it will make much difference. Please note that we have only tested Windows builds using MinGW and MSVC.

Barbara

barbara
Posts: 202
Joined: Sat Apr 04 2015 2:32 am

Re: Please help me build the CopperSpice library!

Post by barbara »

Also a question about Postgresql and the header file 'C:/Program Files/PostgreSQL/12/include/pthread.h' . What should I do?
There was no real question here, but I scrolled through the error messages you posted. I have summarized them here:
CMake Warning at CMakeLists.txt:275 (message): The 'C:/Program Files/PostgreSQL/12/include' directory contains a file called pthread.h
A conflict exists between pthread.h and the standard library
Rename or remove pthread.h in order to build the CsSqlPsql plugin
Yes, PostgreSQL made some changes with version 10 and then are releasing a pthread.h file which is not compatible with the corresponding file in MinGW. The solution is pretty easy and documented in this error message. Since we need to use the file which shipped with MinGW, simply rename the pthread.h file in your PostreSQL folder.

Barbara

Navadvipa Chandra d
Posts: 7
Joined: Sun Apr 19 2020 7:02 pm

Re: Please help me build the CopperSpice library!

Post by Navadvipa Chandra d »

Hare Krishna Barabara and All!

Barbara, your advice on the -j1 option for Ninja has been very helpful. I installed Windows 10 again and with the -j1 parameter the computer worked without voltage. It took less than a day to fully compile CopperSpice. Kitchensink also compiled with Cmake and Ninja. So you can safely recommend 4GB of RAM for the successful compilation of CopperSpice. My processor has four cores.
The next step will be to build your own project similar to Kitchensink.

Thank You!
Hare Krishna!
With best regards, Navadvipa Chandra das.

barbara
Posts: 202
Joined: Sat Apr 04 2015 2:32 am

Re: Please help me build the CopperSpice library!

Post by barbara »

So you can safely recommend 4GB of RAM for the successful compilation of CopperSpice.
There is no recommended amount of memory, however doing C++ development with only 4 GB of ram is not advised and will be slow. If you want to build a reasonable size application I would suggest you upgrade to at least 12 or 16 GB. This will allow you to use all four cores on your computer. This has nothing to do with CopperSpice, modern C++ compilers simply need a lot of memory.


Barbara

Post Reply