libftdi Archives

Subject: Re: Building libftdi under Windows with MSYS2

From: Xiaofan Chen <xiaofanc@xxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Mon, 2 Jan 2017 09:51:34 +0800
On Mon, Dec 14, 2015 at 10:09 PM, Xiaofan Chen <xiaofanc@xxxxxxxxx> wrote:
> 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.

Today I tried again to use latest version of MSYS2 to build libftdi git
and it is still quite smooth.

Other than the basic development packages, git, cmake, doxygen
are also necessary. Of course they may not need to be from MSYS2
as long as they are in the PATH.

Then Boost, Python, Swig, libusb, libconfuse, pkg-config need to be
installed for
the respective 32bit or 64bit target.

mcuee@Win7HomeX64_PC MINGW64 /h/work/libftdi/libftdi/build_mingw64
$ pacman -Qs boost
local/mingw-w64-i686-boost 1.62.0-1
    Free peer-reviewed portable C++ source libraries (mingw-w64)
local/mingw-w64-x86_64-boost 1.62.0-1
    Free peer-reviewed portable C++ source libraries (mingw-w64)

mcuee@Win7HomeX64_PC MINGW64 /h/work/libftdi/libftdi/build_mingw64
$ pacman -Qs python3
local/mingw-w64-i686-python3 3.5.2-4
    A high-level scripting language (mingw-w64)
local/mingw-w64-x86_64-python3 3.5.2-4
    A high-level scripting language (mingw-w64)

mcuee@Win7HomeX64_PC MINGW64 /h/work/libftdi/libftdi/build_mingw64
$ pacman -Qs swig
local/mingw-w64-i686-swig 3.0.6-1
    Generate scripting interfaces to C/C++ code
local/mingw-w64-x86_64-swig 3.0.6-1
    Generate scripting interfaces to C/C++ code

mcuee@Win7HomeX64_PC MINGW64 /h/work/libftdi/libftdi/build_mingw64
$ pacman -Qs libusb
local/mingw-w64-i686-libusb 1.0.20-1
    Library that provides generic access to USB devices (mingw-w64)
local/mingw-w64-i686-libusb-compat-git r60.072a5e4-3
    libusb provides generic access to USB devices (mingw-w64)
local/mingw-w64-x86_64-libusb 1.0.20-1
    Library that provides generic access to USB devices (mingw-w64)
local/mingw-w64-x86_64-libusb-compat-git r60.072a5e4-3
    libusb provides generic access to USB devices (mingw-w64)

mcuee@Win7HomeX64_PC MINGW64 /h/work/libftdi/libftdi/build_mingw64
$ pacman -Qs confuse
local/mingw-w64-i686-confuse 2.8-1
    Library for parsing configuration files (mingw-w64)
local/mingw-w64-x86_64-confuse 2.8-1
    Library for parsing configuration files (mingw-w64)

The following shows the build log under 64bit MinGW-w64.

mcuee@Win7HomeX64_PC MINGW64 /h/work/libftdi/libftdi/build_mingw64
$ cmake .. -G "MSYS Makefiles"
-- The C compiler identification is GNU 6.2.0
-- The CXX compiler identification is GNU 6.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.1")
-- 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.62.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.3-11-g95f6828
-- Building libftdi1++
-- Found SWIG: H:/MSys64/mingw64/bin/swig.exe (found version "3.0.6")
-- Found PythonLibs: H:/Python35_x64/libs/libpython35.a (found version "3.5.2")
-- Found PythonInterp: H:/MSys64/mingw64/bin/python3.5.exe (found
version "3.5.2")
-- Building python bindings via swig. Will be installed under
C:/Program Files (x86)/libftdi1/lib/python3.5/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.62.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_mingw64

mcuee@Win7HomeX64_PC MINGW64 /h/work/libftdi/libftdi/build_mingw64
$ make
Scanning dependencies of target docs
[  2%] Generating doc/html/index.html
warning: ignoring unsupported tag `LATEX_TIMESTAMP        =' at line
1735, file H:/work/libftdi/libftdi/build_mingw64/Doxyfile
[  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
H:/work/libftdi/libftdi/src/ftdi_stream.c: In function 'ftdi_readstream':
H:/work/libftdi/libftdi/src/ftdi_stream.c:234:5: warning: implicit
declaration of function 'gettimeofday'
[-Wimplicit-function-declaration]
     gettimeofday(&state.progress.first.time, NULL);
     ^~~~~~~~~~~~
[  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
H:/work/libftdi/libftdi/src/ftdi_stream.c: In function 'ftdi_readstream':
H:/work/libftdi/libftdi/src/ftdi_stream.c:234:5: warning: implicit
declaration of function 'gettimeofday'
[-Wimplicit-function-declaration]
     gettimeofday(&state.progress.first.time, NULL);
     ^~~~~~~~~~~~
[ 16%] Linking C static library libftdi1.a
[ 16%] Built target ftdi1-static
Scanning dependencies of target ftdipp1-static
[ 18%] Building CXX object ftdipp/CMakeFiles/ftdipp1-static.dir/ftdi.cpp.obj
[ 20%] Linking CXX static library libftdipp1.a
[ 20%] Built target ftdipp1-static
Scanning dependencies of target ftdipp1
[ 23%] Building CXX object ftdipp/CMakeFiles/ftdipp1.dir/ftdi.cpp.obj
[ 25%] Linking CXX shared library libftdipp1.dll
[ 25%] Built target ftdipp1
Scanning dependencies of target doc_i
[ 27%] Generating ../doc/xml/ftdi_8c.xml
warning: ignoring unsupported tag `LATEX_TIMESTAMP        =' at line
1739, file Doxyfile
[ 30%] Generating ftdi1_doc.i
[ 30%] Built target doc_i
[ 32%] Swig source
H:\work\libftdi\libftdi\src\ftdi.h(270) : Warning 451: Setting a const
char * variable may leak memory.
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
H:/work/libftdi/libftdi/build_mingw64/python/ftdi1PYTHON_wrap.c: In
function '_wrap_read_data':
H:/work/libftdi/libftdi/build_mingw64/python/ftdi1PYTHON_wrap.c:3676:3:
warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   if(result<0) arg3=0; resultobj =
SWIG_Python_AppendOutput(resultobj, charp2str((char*)arg2, arg3));
free(arg2);
   ^~
H:/work/libftdi/libftdi/build_mingw64/python/ftdi1PYTHON_wrap.c:3676:24:
note: ...this statement, but the latter is misleadingly indented as if
it is guarded by the 'if'
   if(result<0) arg3=0; resultobj =
SWIG_Python_AppendOutput(resultobj, charp2str((char*)arg2, arg3));
free(arg2);
                        ^~~~~~~~~
H:/work/libftdi/libftdi/build_mingw64/python/ftdi1PYTHON_wrap.c: In
function '_wrap_get_eeprom_buf':
H:/work/libftdi/libftdi/build_mingw64/python/ftdi1PYTHON_wrap.c:3918:3:
warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   if(result<0) arg3=0; resultobj =
SWIG_Python_AppendOutput(resultobj, charp2str((char*)arg2, arg3));
free(arg2);
   ^~
H:/work/libftdi/libftdi/build_mingw64/python/ftdi1PYTHON_wrap.c:3918:24:
note: ...this statement, but the latter is misleadingly indented as if
it is guarded by the 'if'
   if(result<0) arg3=0; resultobj =
SWIG_Python_AppendOutput(resultobj, charp2str((char*)arg2, arg3));
free(arg2);
                        ^~~~~~~~~
[ 37%] Linking C shared module _ftdi1.pyd
[ 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 find_all_pp
[ 44%] Building CXX object
examples/CMakeFiles/find_all_pp.dir/find_all_pp.cpp.obj
[ 46%] Linking CXX executable find_all_pp.exe
[ 46%] Built target find_all_pp
Scanning dependencies of target stream_test
[ 48%] 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:89: 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]
                    fprintf(stderr, "Skip %7d blocks from 0x%08x to
0x%08x at blocks %10llu\n",

^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
H:/work/libftdi/libftdi/examples/stream_test.c:86:89: 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]
                    fprintf(stderr, "Skip %7d blocks from 0x%08x to
0x%08x at blocks %10llu\n",

^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
H:/work/libftdi/libftdi/examples/stream_test.c:101:89: 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]
                    fprintf(stderr, "Skip %7d blocks from 0x%08x to
0x%08x at blocks %10llu\n",

^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
H:/work/libftdi/libftdi/examples/stream_test.c:101:89: 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]
                    fprintf(stderr, "Skip %7d blocks from 0x%08x to
0x%08x at blocks %10llu\n",

^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
H:/work/libftdi/libftdi/examples/stream_test.c: In function 'main':
H:/work/libftdi/libftdi/examples/stream_test.c:250:39: 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:51: 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:57: warning: format
'%d' expects argument of type 'int', but argument 4 has type 'long
long unsigned int' [-Wformat=]
        fprintf(stderr,"%d errors of %llu blocks (%Le), %d (%Le)
blocks skipped\n",
                                                         ^
H:/work/libftdi/libftdi/examples/stream_test.c:250:61: 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: too
many arguments for format [-Wformat-extra-args]
        fprintf(stderr,"%d errors of %llu blocks (%Le), %d (%Le)
blocks skipped\n",

^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
H:/work/libftdi/libftdi/examples/stream_test.c:250:39: 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:51: 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:57: warning: format
'%d' expects argument of type 'int', but argument 4 has type 'long
long unsigned int' [-Wformat=]
        fprintf(stderr,"%d errors of %llu blocks (%Le), %d (%Le)
blocks skipped\n",
                                                         ^
H:/work/libftdi/libftdi/examples/stream_test.c:250:61: 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: too
many arguments for format [-Wformat-extra-args]
        fprintf(stderr,"%d errors of %llu blocks (%Le), %d (%Le)
blocks skipped\n",

^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
H:/work/libftdi/libftdi/examples/stream_test.c: In function 'check_outfile':
H:/work/libftdi/libftdi/examples/stream_test.c:339:90: 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]
                     fprintf(stderr, "Skip %7d blocks from 0x%08x to
0x%08x at blocks %10llu \n",

^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
H:/work/libftdi/libftdi/examples/stream_test.c:339:90: 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]
                     fprintf(stderr, "Skip %7d blocks from 0x%08x to
0x%08x at blocks %10llu \n",

^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
H:/work/libftdi/libftdi/examples/stream_test.c:353:53: 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]
             fprintf(stderr, "%d blocks wrong from %llu blocks read\n",
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
H:/work/libftdi/libftdi/examples/stream_test.c:353:53: 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]
             fprintf(stderr, "%d blocks wrong from %llu blocks read\n",
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
H:/work/libftdi/libftdi/examples/stream_test.c:356:32: 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]
             fprintf(stderr, "%llu blocks all fine\n", (unsigned long
long) blocks);
                             ^~~~~~~~~~~~~~~~~~~~~~~~
H:/work/libftdi/libftdi/examples/stream_test.c:356:32: 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]
             fprintf(stderr, "%llu blocks all fine\n", (unsigned long
long) blocks);
                             ^~~~~~~~~~~~~~~~~~~~~~~~
[ 51%] Linking C executable stream_test.exe
[ 51%] Built target stream_test
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
[ 58%] 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:21: 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]
         printf("%02hhx ",buf[0]);
                ^~~~~~~~~
H:/work/libftdi/libftdi/examples/bitbang.c:64:21: 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]
         printf("%02hhx ",buf[0]);
                ^~~~~~~~~
[ 60%] Linking C executable bitbang.exe
[ 60%] Built target bitbang
Scanning dependencies of target serial_test
[ 62%] Building C object examples/CMakeFiles/serial_test.dir/serial_test.c.obj
[ 65%] Linking C executable serial_test.exe
[ 65%] Built target serial_test
Scanning dependencies of target bitbang_ft2232
[ 67%] Building C object
examples/CMakeFiles/bitbang_ft2232.dir/bitbang_ft2232.c.obj
[ 69%] Linking C executable bitbang_ft2232.exe
[ 69%] Built target bitbang_ft2232
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 simple
[ 76%] Building C object examples/CMakeFiles/simple.dir/simple.c.obj
[ 79%] Linking C executable simple.exe
[ 79%] Built target simple
Scanning dependencies of target baud_test
[ 81%] Building C object examples/CMakeFiles/baud_test.dir/baud_test.c.obj
[ 83%] Linking C executable baud_test.exe
[ 83%] Built target baud_test
Scanning dependencies of target bitbang_cbus
[ 86%] Building C object examples/CMakeFiles/bitbang_cbus.dir/bitbang_cbus.c.obj
[ 88%] Linking C executable bitbang_cbus.exe
[ 88%] Built target bitbang_cbus
Scanning dependencies of target eeprom
[ 90%] Building C object examples/CMakeFiles/eeprom.dir/eeprom.c.obj
[ 93%] Linking C executable eeprom.exe
[ 93%] Built target eeprom
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