DentonW / DevIL

Developer's Image Library (DevIL) is a cross-platform image library utilizing a simple syntax to load, save, convert, manipulate, filter, and display a variety of images with ease. It is highly portable and has been ported to several platforms.
http://openil.sourceforge.net/
GNU Lesser General Public License v2.1
446 stars 138 forks source link

CMake compile error #52

Closed klausenbusk closed 7 years ago

klausenbusk commented 7 years ago

Hello

Something has changed recently, as I can't compile master anymore. I have a git pull (4a2d7822f12c82e6c32b9b51d52c4bdc13ca9375) which compile without any problems, but current HEAD doesn't.

[kristian@arch-hp-laptop build]$ cmake ..
-- The C compiler identification is GNU 6.3.1
-- The CXX compiler identification is GNU 6.3.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- 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: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
DevIL, 64 bit compiler detected
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11") 
-- Found PNG: /usr/lib64/libpng.so (found version "1.6.28") 
-- Found JPEG: /usr/lib64/libjpeg.so  
-- Found TIFF: /usr/lib64/libtiff.so (found version "4.0.7") 
-- Found Jasper: /usr/lib64/libjasper.so (found version "2.0.10") 
-- Could not find libSquish
CMake Warning at src-IL/CMakeLists.txt:106 (find_package):
  By not providing "FindNVTT.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "NVTT", but
  CMake did not find one.

  Could not find a package configuration file provided by "NVTT" with any of
  the following names:

    NVTTConfig.cmake
    nvtt-config.cmake

  Add the installation prefix of "NVTT" to CMAKE_PREFIX_PATH or set
  "NVTT_DIR" to a directory containing one of the above files.  If "NVTT"
  provides a separate development package or SDK, be sure it has been
  installed.

CMake Warning at src-IL/CMakeLists.txt:112 (find_package):
  By not providing "FindOpenEXR.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "OpenEXR", but
  CMake did not find one.

  Could not find a package configuration file provided by "OpenEXR" with any
  of the following names:

    OpenEXRConfig.cmake
    openexr-config.cmake

  Add the installation prefix of "OpenEXR" to CMAKE_PREFIX_PATH or set
  "OpenEXR_DIR" to a directory containing one of the above files.  If
  "OpenEXR" provides a separate development package or SDK, be sure it has
  been installed.

-- Found LCMS2: /usr/lib64/liblcms2.so  

64 bit compiler detected

64 bit compiler detected
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/DevIL/DevIL/build
[kristian@arch-hp-laptop build]$ make
Scanning dependencies of target IL
[  0%] Building CXX object src-IL/CMakeFiles/IL.dir/src/altivec_common.cpp.o
[  1%] Building CXX object src-IL/CMakeFiles/IL.dir/src/altivec_typeconversion.cpp.o
[  2%] Building CXX object src-IL/CMakeFiles/IL.dir/src/il_alloc.cpp.o
[  3%] Building CXX object src-IL/CMakeFiles/IL.dir/src/il_bits.cpp.o
[  4%] Building CXX object src-IL/CMakeFiles/IL.dir/src/il_blp.cpp.o
[  5%] Building CXX object src-IL/CMakeFiles/IL.dir/src/il_bmp.cpp.o
[  6%] Building CXX object src-IL/CMakeFiles/IL.dir/src/il_convbuff.cpp.o
[  7%] Building CXX object src-IL/CMakeFiles/IL.dir/src/il_convert.cpp.o
[  8%] Building CXX object src-IL/CMakeFiles/IL.dir/src/il_cut.cpp.o
[  8%] Building CXX object src-IL/CMakeFiles/IL.dir/src/il_dcx.cpp.o
[  9%] Building CXX object src-IL/CMakeFiles/IL.dir/src/il_dds-save.cpp.o
[ 10%] Building CXX object src-IL/CMakeFiles/IL.dir/src/il_dds.cpp.o
/tmp/DevIL/DevIL/src-IL/src/il_dds.cpp:635:28: fejl: »_In_« was not declared in this scope
 static size_t BitsPerPixel(_In_ DXGI_FORMAT fmt)
                            ^~~~
make[2]: *** [src-IL/CMakeFiles/IL.dir/build.make:327: src-IL/CMakeFiles/IL.dir/src/il_dds.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:86: src-IL/CMakeFiles/IL.dir/all] Error 2
make: *** [Makefile:128: all] Error 2
abma commented 7 years ago

should be fixed with https://github.com/DentonW/DevIL/pull/51/commits/d7583b1fbb729673d6721a7d2611c06daf04abaf

klausenbusk commented 7 years ago

@abma great, I will test when I get home :) A side question, do you know how I disable ex. jpeg support? I tried cmake -DIL_NO_JPG=1 but it still links with libjpeg. I need to include DevIL at a static library, and so I want to reduce the amount of library I need to compile static.

abma commented 7 years ago

afaik cmake -DIL_JPEG_LIB=OFF

abma commented 7 years ago

oops:

https://github.com/DentonW/DevIL/blob/master/DevIL/src-IL/CMakeLists.txt#L154

-DIL_NO_JPG=1 looks ok

klausenbusk commented 7 years ago

-DIL_NO_JPG=1 looks ok

It still seems to link:

[kristian@arch-hp-laptop build]$ cmake -DIL_NO_JPG=1 ..
-- The C compiler identification is GNU 6.3.1
-- The CXX compiler identification is GNU 6.3.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- 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: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
DevIL, 64 bit compiler detected
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11") 
-- Found PNG: /usr/lib64/libpng.so (found version "1.6.28") 
-- Found JPEG: /usr/lib64/libjpeg.so  
-- Found TIFF: /usr/lib64/libtiff.so (found version "4.0.7") 
-- Found Jasper: /usr/lib64/libjasper.so (found version "2.0.10") 
-- Could not find libSquish
-- Found LCMS2: /usr/lib64/liblcms2.so  

64 bit compiler detected

64 bit compiler detected
-- Could NOT find cppunit (missing:  CPPUNIT_LIBRARY CPPUNIT_INCLUDE_DIR) 
-- UnitTest disabled, cppunit wasn't found!
-- Configuring done
-- Generating done
-- Build files have been written to: /home/kristian/Hentninger/DevIL/DevIL/build
-- Build files have been written to: /home/kristian/Hentninger/DevIL/DevIL/build
[kristian@arch-hp-laptop build]$ make
Scanning dependencies of target IL
[  0%] Building CXX object src-IL/CMakeFiles/IL.dir/src/altivec_common.cpp.o
[....]
[100%] Linking CXX shared library ../lib/x64/libILUT.so
[100%] Built target ILUT
[kristian@arch-hp-laptop build]$ ldd lib/x64/*.so | grep libjpeg
    libjpeg.so.8 => /usr/lib/libjpeg.so.8 (0x00007fd6e0956000)
    libjpeg.so.8 => /usr/lib/libjpeg.so.8 (0x00007f456d27f000)
    libjpeg.so.8 => /usr/lib/libjpeg.so.8 (0x00007f3453b93000)

so I'm wondering if something is broken in the cmake script.

abma commented 7 years ago

IMHO you should open a new issue for that.

klausenbusk commented 7 years ago

IMHO you should open a new issue for that.

You correct :) I have opened a new one now https://github.com/DentonW/DevIL/issues/53

abma commented 7 years ago

@klausenbusk

is this issue fixed with the most recent changes? if so, please close this issue.

klausenbusk commented 7 years ago

is this issue fixed with the most recent changes? if so, please close this issue.

It is, I didn't see the PR was merged, thanks for notifying me :)