0

Answered below! Thanks @drescherjm

I am having some trouble generating the initial red rectangle in gdstk. I have copy-pasted source code below into a "Hello World" default Project in Eclipse but am getting the above error. I assume its because I need to "point" or include the referenced header file or somewhere include it in list of things to look [in binaries for (much like and <stdio.h> live)]. I have looked in Eclipse's help menu on how to add to the pile of ".h" file headers, but seems help menu is broken there too.

C++ code in eclipse:
C++ code in eclipse

Project Explorer Window:
Project Explorer Window

Adding in that I did eventually get it loaded in as a project (I think) from Git perspective tool within Eclipse but now when "building" I get the following error "No Toolchain". Original error has been surpassed by this one hahah.**

[No Toolchain found][3]

Tried some suggestions below *"change directory to the folder containing the CMakeLists.txt. Then type mkdir build and press enter then type cmake -S. -B build and press enter. This should build a C++ static library in the build folder

After that I got the following error:

(base) C:\Users\me>cd C:\Users\me\git\gdstk

(base) C:\Users\me\git\gdstk>mkdir build
A subdirectory or file build already exists.

(base) C:\Users\me\git\gdstk>cmake -S . -B build
-- Building for: NMake Makefiles
CMake Error at CMakeLists.txt:7 (project):
  Running

   'nmake' '-?'

  failed with:

   The system cannot find the file specified


CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "C:/Users/me/git/gdstk/build/CMakeFiles/CMakeOutput.log".

I tried some more stuff and am now stuck here:**

(base) C:\Users\me>conda config --env --add channels conda-forge

(base) C:\Users\me>conda config --env --set channel_priority strict

(base) C:\Users\me># Install gdstk
'#' is not recognized as an internal or external command,
operable program or batch file.

(base) C:\Users\me>conda config --env --add channels conda-forge
Warning: 'conda-forge' already in 'channels' list, moving to the top

(base) C:\Users\me>conda config --env --set channel_priority strict

(base) C:\Users\me>conda install gdstk
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: done

## Package Plan ##

  environment location: C:\Users\me\Anaconda3

  added / updated specs:
    - gdstk


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    gdstk-0.5.0                |   py39h5ff6c76_0         489 KB  conda-forge
    libblas-3.9.0              |1_h8933c1f_netlib         193 KB  conda-forge
    liblapack-3.9.0            |5_hd5c7e75_netlib         2.7 MB  conda-forge
    libsodium-1.0.18           |       h62dcd97_0         477 KB
    zeromq-4.3.4               |       hd77b12b_0         4.2 MB
    ------------------------------------------------------------
                                           Total:         8.1 MB

The following NEW packages will be INSTALLED:

  gdstk              conda-forge/win-64::gdstk-0.5.0-py39h5ff6c76_0
  libblas            conda-forge/win-64::libblas-3.9.0-1_h8933c1f_netlib
  liblapack          conda-forge/win-64::liblapack-3.9.0-5_hd5c7e75_netlib

The following packages will be SUPERSEDED by a higher-priority channel:

  conda              conda-forge::conda-4.12.0-py39hcbf530~ --> pkgs/main::conda-4.12.0-py39haa95532_0
  libsodium          conda-forge::libsodium-1.0.18-h8d1472~ --> pkgs/main::libsodium-1.0.18-h62dcd97_0
  zeromq               conda-forge::zeromq-4.3.4-h0e60522_1 --> pkgs/main::zeromq-4.3.4-hd77b12b_0


Proceed ([y]/n)? y


Downloading and Extracting Packages
zeromq-4.3.4         | 4.2 MB    | ############################################################################ | 100%
gdstk-0.5.0          | 489 KB    | ############################################################################ | 100%
libblas-3.9.0        | 193 KB    | ############################################################################ | 100%
liblapack-3.9.0      | 2.7 MB    | ############################################################################ | 100%
libsodium-1.0.18     | 477 KB    | ############################################################################ | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

(base) C:\Users\me>cd C:\Users\me\git\gdstk

(base) C:\Users\me\git\gdstk>mkdir build
A subdirectory or file build already exists.

(base) C:\Users\me\git\gdstk>python setup.py install
running install
running bdist_egg
running egg_info
writing gdstk.egg-info\PKG-INFO
writing dependency_links to gdstk.egg-info\dependency_links.txt
writing requirements to gdstk.egg-info\requires.txt
writing top-level names to gdstk.egg-info\top_level.txt
reading manifest file 'gdstk.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE'
writing manifest file 'gdstk.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_ext
cmake -S C:\Users\me\git\gdstk -B C:\Users\me\git\gdstk\build\temp.win-amd64-3.9\Release\cmake_build -DCMAKE_INSTALL_PREFIX=C:\Users\me\git\gdstk\build\temp.win-amd64-3.9\Release\cmake_build\install -DCMAKE_BUILD_TYPE=Release
CMake Error at CMakeLists.txt:7 (project):
  Running

   'nmake' '-?'

  failed with:

   The system cannot find the file specified


CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "C:/Users/me/git/gdstk/build/temp.win-amd64-3.9/Release/cmake_build/CMakeFiles/CMakeOutput.log".
error: command 'C:\\Program Files\\CMake\\bin\\cmake.exe' failed with exit code 1

(base) C:\Users\me\git\gdstk>cmake -S . -B build
CMake Error at CMakeLists.txt:7 (project):
  Running

   'nmake' '-?'

  failed with:

   The system cannot find the file specified


CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "C:/Users/me/git/gdstk/build/CMakeFiles/CMakeOutput.log".

(base) C:\Users\me\git\gdstk>

EDIT I tried the first answer given below and am running into the following issue when configuring/generating cmake:

me@l-ul71kght6q MINGW64 ~/projects/gdstk
$ cmake -S . -B build -G"MSYS Makefiles"
CMake Error: Could not create named generator MSYS Makefiles

Generators
* Unix Makefiles               = Generates standard UNIX makefiles.
  Ninja                        = Generates build.ninja files.
  Ninja Multi-Config           = Generates build-<Config>.ninja files.
  CodeBlocks - Ninja           = Generates CodeBlocks project files.
  CodeBlocks - Unix Makefiles  = Generates CodeBlocks project files.
  CodeLite - Ninja             = Generates CodeLite project files.
  CodeLite - Unix Makefiles    = Generates CodeLite project files.
  Eclipse CDT4 - Ninja         = Generates Eclipse CDT 4.0 project files.
  Eclipse CDT4 - Unix Makefiles= Generates Eclipse CDT 4.0 project files.
  Kate - Ninja                 = Generates Kate project files.
  Kate - Unix Makefiles        = Generates Kate project files.
  Sublime Text 2 - Ninja       = Generates Sublime Text 2 project files.
  Sublime Text 2 - Unix Makefiles
                               = Generates Sublime Text 2 project files.

 
  • So is gdsdk.h in any of those include folders? Where did you put that file or how did you install it? – drescherjm Apr 21 '22 at 17:03
  • cloned using git to folder in C:\Users\User\Documents\GDSTK\gdstk\src. This is where it lives. I looked through the "Binary" folder in the Project WIndow and didn't see it there. – Mark so Fine Apr 21 '22 at 18:14
  • You probably need to compile it. If you are talking about this repository you do and the instructions are here: [https://github.com/heitzmann/gdstk#installation](https://github.com/heitzmann/gdstk#installation) – drescherjm Apr 21 '22 at 18:21
  • I've read those instructions and short of them saying "This is compiling, heres steps a - z" I am not sure how to proceed. I've tried dragging and dropping whole repository file downloaded from GitHub and running stuff/building stuff within Eclipse to no avail. I feel like I am missing something simple. – Mark so Fine Apr 22 '22 at 15:00
  • New error. I have been able to import from git the project but now when trying to build I get a "No Toolchain found for Target Local" error. I added image to the original post. – Mark so Fine Apr 22 '22 at 15:59
  • You should not be building inside of eclipse. Instead Install CMake and configure and compile from the terminal or command prompt. – drescherjm Apr 22 '22 at 16:10
  • help me out here, CMake installed but I shouldnt be building/compiling from Eclipse? How to compile from command prompt? – Mark so Fine Apr 22 '22 at 17:37
  • The library itself configures and builds using CMake. You could have it generate an eclipse Makefile and build inside the IDE but it's probably simpler to just build from the shell. – drescherjm Apr 22 '22 at 17:42
  • change directory to the folder containing the CMakeLists.txt. Then type `mkdir build` and press enter then type `cmake -S . -B build` and press enter. This should build a c++ static library in the build folder – drescherjm Apr 22 '22 at 17:47
  • @drescherjm tried your suggestion and got following (see edit up in original post) – Mark so Fine Apr 22 '22 at 18:03
  • I understand. Eclipse will write/modify the code, but it needs compiled or build in the python wrapper – Mark so Fine Apr 22 '22 at 18:09
  • Did you install a compiler? I see you are on windows use msys2 to install mingw: [https://stackoverflow.com/questions/30069830/how-to-install-mingw-w64-and-msys2](https://stackoverflow.com/questions/30069830/how-to-install-mingw-w64-and-msys2) – drescherjm Apr 22 '22 at 18:10
  • yes mingw is installed – Mark so Fine Apr 22 '22 at 21:10
  • I answered showing you all the steps I took to build and install this in the mingw64 from msys2. – drescherjm Apr 23 '22 at 12:07

1 Answers1

0

Prerequisites: Install MinGW using MSYS2: How to install MinGW-w64 and MSYS2?

To build gdstk I opened the C:\msys64 folder in the windows 10 file explorer and double clicked on mingw64.exe to open a terminal with mingw64 setup.

Make sure you have cmake installed in msys2:

JMDLAPTOP1+dresc@JMDLAPTOP1 MINGW64 ~
# pacman -S cmake
warning: cmake-3.22.1-2 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) cmake-3.22.1-2

Total Installed Size:  35.63 MiB
Net Upgrade Size:       0.00 MiB

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring                     [#####################] 100%
(1/1) checking package integrity                   [#####################] 100%
(1/1) loading package files                        [#####################] 100%
(1/1) checking for file conflicts                  [#####################] 100%
(1/1) checking available disk space                [#####################] 100%
:: Processing package changes...
(1/1) reinstalling cmake                           [#####################] 100%

I then typed the following to create and change directory to a projects folder:

JMDLAPTOP1+dresc@JMDLAPTOP1 MINGW64 ~
# mkdir projects

JMDLAPTOP1+dresc@JMDLAPTOP1 MINGW64 ~
# cd projects/

Then clone the repository:

JMDLAPTOP1+dresc@JMDLAPTOP1 MINGW64 ~/projects
# git clone https://github.com/heitzmann/gdstk.git
Cloning into 'gdstk'...
remote: Enumerating objects: 3789, done.
remote: Counting objects: 100% (618/618), done.
remote: Compressing objects: 100% (121/121), done.
remote: Total 3789 (delta 524), reused 497 (delta 497), pack-reused 3171
Receiving objects: 100% (3789/3789), 4.83 MiB | 13.37 MiB/s, done.
Resolving deltas: 100% (2982/2982), done.

Then change directory to the gdsdk folder and create a build folder:

JMDLAPTOP1+dresc@JMDLAPTOP1 MINGW64 ~/projects
# cd gdstk/

JMDLAPTOP1+dresc@JMDLAPTOP1 MINGW64 ~/projects/gdstk
# mkdir build

Then configure and generate in cmake.

JMDLAPTOP1+dresc@JMDLAPTOP1 MINGW64 ~/projects/gdstk
# cmake -S . -B build -G"MSYS Makefiles"
-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/mingw64/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/mingw64/bin/g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ZLIB: C:/msys64/mingw64/lib/libz.dll.a (found suitable version "1.2.12", minimum required is "1.2.9")
-- Configuring done
-- Generating done
-- Build files have been written to: C:/msys64/home/dresc/projects/gdstk/build

JMDLAPTOP1+dresc@JMDLAPTOP1 MINGW64 ~/projects/gdstk
#

Then build and install:

JMDLAPTOP1+dresc@JMDLAPTOP1 MINGW64 ~/projects/gdstk
# cmake --build build --target install
[  2%] Building CXX object CMakeFiles/gdstk.dir/src/cell.cpp.obj
[  5%] Building CXX object CMakeFiles/gdstk.dir/src/clipper_tools.cpp.obj
[  8%] Building CXX object CMakeFiles/gdstk.dir/src/curve.cpp.obj
[ 11%] Building CXX object CMakeFiles/gdstk.dir/src/flexpath.cpp.obj
[ 14%] Building CXX object CMakeFiles/gdstk.dir/src/gdsii.cpp.obj
[ 17%] Building CXX object CMakeFiles/gdstk.dir/src/label.cpp.obj
[ 20%] Building CXX object CMakeFiles/gdstk.dir/src/library.cpp.obj
[ 22%] Building CXX object CMakeFiles/gdstk.dir/src/oasis.cpp.obj
[ 25%] Building CXX object CMakeFiles/gdstk.dir/src/polygon.cpp.obj
[ 28%] Building CXX object CMakeFiles/gdstk.dir/src/property.cpp.obj
[ 31%] Building CXX object CMakeFiles/gdstk.dir/src/rawcell.cpp.obj
[ 34%] Building CXX object CMakeFiles/gdstk.dir/src/reference.cpp.obj
[ 37%] Building CXX object CMakeFiles/gdstk.dir/src/repetition.cpp.obj
[ 40%] Building CXX object CMakeFiles/gdstk.dir/src/robustpath.cpp.obj
[ 42%] Building CXX object CMakeFiles/gdstk.dir/src/style.cpp.obj
[ 45%] Building CXX object CMakeFiles/gdstk.dir/src/utils.cpp.obj
[ 48%] Building CXX object CMakeFiles/gdstk.dir/src/clipperlib/clipper.cpp.obj
[ 51%] Building C object CMakeFiles/gdstk.dir/src/libqhull_r/global_r.c.obj
[ 54%] Building C object CMakeFiles/gdstk.dir/src/libqhull_r/stat_r.c.obj
[ 57%] Building C object CMakeFiles/gdstk.dir/src/libqhull_r/geom2_r.c.obj
[ 60%] Building C object CMakeFiles/gdstk.dir/src/libqhull_r/poly2_r.c.obj
[ 62%] Building C object CMakeFiles/gdstk.dir/src/libqhull_r/merge_r.c.obj
[ 65%] Building C object CMakeFiles/gdstk.dir/src/libqhull_r/libqhull_r.c.obj
[ 68%] Building C object CMakeFiles/gdstk.dir/src/libqhull_r/geom_r.c.obj
[ 71%] Building C object CMakeFiles/gdstk.dir/src/libqhull_r/poly_r.c.obj
[ 74%] Building C object CMakeFiles/gdstk.dir/src/libqhull_r/qset_r.c.obj
[ 77%] Building C object CMakeFiles/gdstk.dir/src/libqhull_r/mem_r.c.obj
[ 80%] Building C object CMakeFiles/gdstk.dir/src/libqhull_r/random_r.c.obj
[ 82%] Building C object CMakeFiles/gdstk.dir/src/libqhull_r/usermem_r.c.obj
[ 85%] Building C object CMakeFiles/gdstk.dir/src/libqhull_r/userprintf_r.c.obj
[ 88%] Building C object CMakeFiles/gdstk.dir/src/libqhull_r/io_r.c.obj
[ 91%] Building C object CMakeFiles/gdstk.dir/src/libqhull_r/user_r.c.obj
[ 94%] Building C object CMakeFiles/gdstk.dir/src/libqhull_r/rboxlib_r.c.obj
[ 97%] Building C object CMakeFiles/gdstk.dir/src/libqhull_r/userprintf_rbox_r.c.obj
[100%] Linking CXX static library libgdstk.a
[100%] Built target gdstk
Install the project...
-- Install configuration: "Release"
-- Installing: C:/Program Files (x86)/gdstk/lib/libgdstk.a
-- Installing: C:/Program Files (x86)/gdstk/include/gdstk/allocator.h
-- Installing: C:/Program Files (x86)/gdstk/include/gdstk/array.h
-- Installing: C:/Program Files (x86)/gdstk/include/gdstk/cell.h
-- Installing: C:/Program Files (x86)/gdstk/include/gdstk/clipper_tools.h
-- Installing: C:/Program Files (x86)/gdstk/include/gdstk/curve.h
-- Installing: C:/Program Files (x86)/gdstk/include/gdstk/flexpath.h
-- Installing: C:/Program Files (x86)/gdstk/include/gdstk/font.h
-- Installing: C:/Program Files (x86)/gdstk/include/gdstk/gdsii.h
-- Installing: C:/Program Files (x86)/gdstk/include/gdstk/gdswriter.h
-- Installing: C:/Program Files (x86)/gdstk/include/gdstk/label.h
-- Installing: C:/Program Files (x86)/gdstk/include/gdstk/library.h
-- Installing: C:/Program Files (x86)/gdstk/include/gdstk/map.h
-- Installing: C:/Program Files (x86)/gdstk/include/gdstk/oasis.h
-- Installing: C:/Program Files (x86)/gdstk/include/gdstk/pathcommon.h
-- Installing: C:/Program Files (x86)/gdstk/include/gdstk/polygon.h
-- Installing: C:/Program Files (x86)/gdstk/include/gdstk/property.h
-- Installing: C:/Program Files (x86)/gdstk/include/gdstk/rawcell.h
-- Installing: C:/Program Files (x86)/gdstk/include/gdstk/reference.h
-- Installing: C:/Program Files (x86)/gdstk/include/gdstk/repetition.h
-- Installing: C:/Program Files (x86)/gdstk/include/gdstk/robustpath.h
-- Installing: C:/Program Files (x86)/gdstk/include/gdstk/set.h
-- Installing: C:/Program Files (x86)/gdstk/include/gdstk/sort.h
-- Installing: C:/Program Files (x86)/gdstk/include/gdstk/style.h
-- Installing: C:/Program Files (x86)/gdstk/include/gdstk/utils.h
-- Installing: C:/Program Files (x86)/gdstk/include/gdstk/vec.h
-- Installing: C:/Program Files (x86)/gdstk/include/gdstk.h
-- Installing: C:/Program Files (x86)/gdstk/lib/pkgconfig/gdstk.pc
drescherjm
  • 10,365
  • 5
  • 44
  • 64