libftdi Archives

Subject: Building libftdi under Windows with MSYS2

From: Xiaofan Chen <xiaofanc@xxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Mon, 14 Dec 2015 22:09:27 +0800
Today I tried to build libftdi git under MSYS2 and it seems to be
quite easy. Just need to install the necessary dependencies using
MSYS2 pacman.

The only problem seems to be with the Python 2.7 64bit. I think
last time I spent quite sometime trying to get 64bit Python
bindings to be built for Python 2.7.

Therefore I think I do not need to publish the binaries. Users under
Windows are encouraged to use MSYS2.

MSYS2:
https://msys2.github.io/
http://sourceforge.net/projects/msys2/

mcuee@Win7HomeX64_PC MINGW64 /h/work/libftdi/libftdi/build
$ cmake -G "MSYS Makefiles" ..
-- The C compiler identification is GNU 5.2.0
-- The CXX compiler identification is GNU 5.2.0
-- Check for working C compiler: H:/MSys64/mingw64/bin/gcc.exe
-- Check for working C compiler: H:/MSys64/mingw64/bin/gcc.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: H:/MSys64/mingw64/bin/g++.exe
-- Check for working CXX compiler: H:/MSys64/mingw64/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Build type: RelWithDebInfo
-- Found PkgConfig: H:/MSys64/mingw64/bin/pkg-config.exe (found version "0.29")
-- checking for module 'libusb-1.0'
--   found libusb-1.0, version 1.0.20
-- Found LIBUSB: H:/MSys64/mingw64/lib/libusb-1.0.dll.a
-- Boost version: 1.59.0
-- Found Doxygen: H:/Programs/doxygen/bin/doxygen.exe (found version "1.8.10")
-- Doxygen found.
-- Generating API documentation with Doxygen
-- Detected git snapshot version: v1.2-23-gc4c9f0a
-- Building libftdi1++
-- Found SWIG: H:/MSys64/mingw64/bin/swig.exe (found version "3.0.6")
-- Found PythonLibs: H:/Python27_x64/libs/libpython27.a (found version "2.7.11")
-- Found PythonInterp: H:/Python27_x64/python.exe (found version "2.7.11")
-- Building python bindings via swig. Will be installed under
C:/Program Files (x86)/libftdi1/Lib/site-packages
-- Found Confuse: H:/MSys64/mingw64/lib/libconfuse.dll.a
-- Looking for dgettext
-- Looking for dgettext - not found
-- Found Libintl: H:/MSys64/mingw64/include
-- Building ftdi_eeprom
-- Building example programs.
-- Building libftdi++ examples.
-- Boost version: 1.59.0
-- Found the following Boost libraries:
--   unit_test_framework
-- Building unit test
-- Configuring done
-- Generating done
-- Build files have been written to: H:/work/libftdi/libftdi/build


mcuee@Win7HomeX64_PC MINGW64 /h/work/libftdi/libftdi/build
$ make
Scanning dependencies of target docs
[  2%] Generating doc/html/index.html
warning: Tag `XML_SCHEMA' at line 1797 of file
`H:/work/libftdi/libftdi/build/Doxyfile' has become obsolete.
         To avoid this warning please remove this line from your
configuration file or upgrade it using "doxygen -u"
warning: Tag `XML_DTD' at line 1803 of file
`H:/work/libftdi/libftdi/build/Doxyfile' has become obsolete.
         To avoid this warning please remove this line from your
configuration file or upgrade it using "doxygen -u"
[  2%] Built target docs
Scanning dependencies of target ftdi1
[  4%] Building C object src/CMakeFiles/ftdi1.dir/ftdi.c.obj
[  6%] Building C object src/CMakeFiles/ftdi1.dir/ftdi_stream.c.obj
[  9%] Linking C shared library libftdi1.dll
[  9%] Built target ftdi1
Scanning dependencies of target ftdi1-static
[ 11%] Building C object src/CMakeFiles/ftdi1-static.dir/ftdi.c.obj
[ 13%] Building C object src/CMakeFiles/ftdi1-static.dir/ftdi_stream.c.obj
[ 16%] Linking C static library libftdi1.a
[ 16%] Built target ftdi1-static
Scanning dependencies of target ftdipp1
[ 18%] Building CXX object ftdipp/CMakeFiles/ftdipp1.dir/ftdi.cpp.obj
[ 20%] Linking CXX shared library libftdipp1.dll
[ 20%] Built target ftdipp1
Scanning dependencies of target ftdipp1-static
[ 23%] Building CXX object ftdipp/CMakeFiles/ftdipp1-static.dir/ftdi.cpp.obj
[ 25%] Linking CXX static library libftdipp1.a
[ 25%] Built target ftdipp1-static
Scanning dependencies of target doc_i
[ 27%] Generating ../doc/xml/ftdi_8c.xml
warning: Tag `XML_SCHEMA' at line 1801 of file `Doxyfile' has become obsolete.
         To avoid this warning please remove this line from your
configuration file or upgrade it using "doxygen -u"
warning: Tag `XML_DTD' at line 1807 of file `Doxyfile' has become obsolete.
         To avoid this warning please remove this line from your
configuration file or upgrade it using "doxygen -u"
[ 30%] Generating ftdi1_doc.i
[ 30%] Built target doc_i
[ 32%] Swig source
H:\work\libftdi\libftdi\src\ftdi_i.h(131) : Warning 451: Setting a
const char * variable may leak memory.
Scanning dependencies of target _ftdi1
[ 34%] Building C object python/CMakeFiles/_ftdi1.dir/ftdi1PYTHON_wrap.c.obj
[ 37%] Linking C shared module _ftdi1.pyd
CMakeFiles/_ftdi1.dir/objects.a(ftdi1PYTHON_wrap.c.obj): In function
`init_ftdi1':
H:/work/libftdi/libftdi/build/python/ftdi1PYTHON_wrap.c:16293:
undefined reference to `__imp_Py_InitModule4'
collect2.exe: error: ld returned 1 exit status
python/CMakeFiles/_ftdi1.dir/build.make:104: recipe for target
'python/_ftdi1.pyd' failed
make[2]: *** [python/_ftdi1.pyd] Error 1
CMakeFiles/Makefile2:346: recipe for target
'python/CMakeFiles/_ftdi1.dir/all' failed
make[1]: *** [python/CMakeFiles/_ftdi1.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

mcuee@Win7HomeX64_PC MINGW64 /h/work/libftdi/libftdi/build
$ make -i
[  2%] Built target docs
[  9%] Built target ftdi1
[ 16%] Built target ftdi1-static
[ 20%] Built target ftdipp1
[ 25%] Built target ftdipp1-static
[ 30%] Built target doc_i
[ 32%] Linking C shared module _ftdi1.pyd
CMakeFiles/_ftdi1.dir/objects.a(ftdi1PYTHON_wrap.c.obj): In function
`init_ftdi1':
H:/work/libftdi/libftdi/build/python/ftdi1PYTHON_wrap.c:16293:
undefined reference to `__imp_Py_InitModule4'
collect2.exe: error: ld returned 1 exit status
[ 37%] Built target _ftdi1
Scanning dependencies of target ftdi_eeprom
[ 39%] Building C object ftdi_eeprom/CMakeFiles/ftdi_eeprom.dir/main.c.obj
[ 41%] Linking C executable ftdi_eeprom.exe
[ 41%] Built target ftdi_eeprom
Scanning dependencies of target baud_test
[ 44%] Building C object examples/CMakeFiles/baud_test.dir/baud_test.c.obj
[ 46%] Linking C executable baud_test.exe
[ 46%] Built target baud_test
Scanning dependencies of target bitbang
[ 48%] Building C object examples/CMakeFiles/bitbang.dir/bitbang.c.obj
H:/work/libftdi/libftdi/examples/bitbang.c: In function 'main':
H:/work/libftdi/libftdi/examples/bitbang.c:64:16: warning: unknown
conversion type character 'h' in format [-Wformat=]
         printf("%02hhx ",buf[0]);
                ^
H:/work/libftdi/libftdi/examples/bitbang.c:64:16: warning: too many
arguments for format [-Wformat-extra-args]
[ 51%] Linking C executable bitbang.exe
[ 51%] Built target bitbang
Scanning dependencies of target bitbang2
[ 53%] Building C object examples/CMakeFiles/bitbang2.dir/bitbang2.c.obj
[ 55%] Linking C executable bitbang2.exe
[ 55%] Built target bitbang2
Scanning dependencies of target bitbang_cbus
[ 58%] Building C object examples/CMakeFiles/bitbang_cbus.dir/bitbang_cbus.c.obj
[ 60%] Linking C executable bitbang_cbus.exe
[ 60%] Built target bitbang_cbus
Scanning dependencies of target bitbang_ft2232
[ 62%] Building C object
examples/CMakeFiles/bitbang_ft2232.dir/bitbang_ft2232.c.obj
[ 65%] Linking C executable bitbang_ft2232.exe
[ 65%] Built target bitbang_ft2232
Scanning dependencies of target eeprom
[ 67%] Building C object examples/CMakeFiles/eeprom.dir/eeprom.c.obj
[ 69%] Linking C executable eeprom.exe
[ 69%] Built target eeprom
Scanning dependencies of target find_all
[ 72%] Building C object examples/CMakeFiles/find_all.dir/find_all.c.obj
[ 74%] Linking C executable find_all.exe
[ 74%] Built target find_all
Scanning dependencies of target find_all_pp
[ 76%] Building CXX object
examples/CMakeFiles/find_all_pp.dir/find_all_pp.cpp.obj
[ 79%] Linking CXX executable find_all_pp.exe
[ 79%] Built target find_all_pp
Scanning dependencies of target serial_test
[ 81%] Building C object examples/CMakeFiles/serial_test.dir/serial_test.c.obj
[ 83%] Linking C executable serial_test.exe
[ 83%] Built target serial_test
Scanning dependencies of target simple
[ 86%] Building C object examples/CMakeFiles/simple.dir/simple.c.obj
[ 88%] Linking C executable simple.exe
[ 88%] Built target simple
Scanning dependencies of target stream_test
[ 90%] Building C object examples/CMakeFiles/stream_test.dir/stream_test.c.obj
H:/work/libftdi/libftdi/examples/stream_test.c: In function 'readCallback':
H:/work/libftdi/libftdi/examples/stream_test.c:86:36: warning: unknown
conversion type character 'l' in format [-Wformat=]
                    fprintf(stderr, "Skip %7d blocks from 0x%08x to
0x%08x at blocks %10llu\n",
                                    ^
H:/work/libftdi/libftdi/examples/stream_test.c:86:36: warning: too
many arguments for format [-Wformat-extra-args]
H:/work/libftdi/libftdi/examples/stream_test.c:101:36: warning:
unknown conversion type character 'l' in format [-Wformat=]
                    fprintf(stderr, "Skip %7d blocks from 0x%08x to
0x%08x at blocks %10llu\n",
                                    ^
H:/work/libftdi/libftdi/examples/stream_test.c:101:36: warning: too
many arguments for format [-Wformat-extra-args]
H:/work/libftdi/libftdi/examples/stream_test.c: In function 'main':
H:/work/libftdi/libftdi/examples/stream_test.c:250:23: warning:
unknown conversion type character 'l' in format [-Wformat=]
        fprintf(stderr,"%d errors of %llu blocks (%Le), %d (%Le)
blocks skipped\n",
                       ^
H:/work/libftdi/libftdi/examples/stream_test.c:250:23: warning:
unknown conversion type character 'L' in format [-Wformat=]
H:/work/libftdi/libftdi/examples/stream_test.c:250:23: warning: format
'%d' expects argument of type 'int', but argument 4 has type 'long
long unsigned int' [-Wformat=]
H:/work/libftdi/libftdi/examples/stream_test.c:250:23: warning:
unknown conversion type character 'L' in format [-Wformat=]
H:/work/libftdi/libftdi/examples/stream_test.c:250:23: warning: too
many arguments for format [-Wformat-extra-args]
H:/work/libftdi/libftdi/examples/stream_test.c: In function 'check_outfile':
H:/work/libftdi/libftdi/examples/stream_test.c:339:37: warning:
unknown conversion type character 'l' in format [-Wformat=]
                     fprintf(stderr, "Skip %7d blocks from 0x%08x to
0x%08x at blocks %10llu \n",
                                     ^
H:/work/libftdi/libftdi/examples/stream_test.c:339:37: warning: too
many arguments for format [-Wformat-extra-args]
H:/work/libftdi/libftdi/examples/stream_test.c:353:29: warning:
unknown conversion type character 'l' in format [-Wformat=]
             fprintf(stderr, "%d blocks wrong from %llu blocks read\n",
                             ^
H:/work/libftdi/libftdi/examples/stream_test.c:353:29: warning: too
many arguments for format [-Wformat-extra-args]
H:/work/libftdi/libftdi/examples/stream_test.c:356:29: warning:
unknown conversion type character 'l' in format [-Wformat=]
             fprintf(stderr, "%llu blocks all fine\n", (unsigned long
long) blocks);
                             ^
H:/work/libftdi/libftdi/examples/stream_test.c:356:29: warning: too
many arguments for format [-Wformat-extra-args]
[ 93%] Linking C executable stream_test.exe
[ 93%] Built target stream_test
Scanning dependencies of target test_libftdi1
[ 95%] Building CXX object test/CMakeFiles/test_libftdi1.dir/basic.cpp.obj
[ 97%] Building CXX object test/CMakeFiles/test_libftdi1.dir/baudrate.cpp.obj
[100%] Linking CXX executable test_libftdi1.exe
[100%] Built target test_libftdi1



-- 
Xiaofan

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread