Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows support #19

Open
lungben opened this issue Nov 20, 2020 · 5 comments
Open

Windows support #19

lungben opened this issue Nov 20, 2020 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@lungben
Copy link

lungben commented Nov 20, 2020

In my experience, Windows is often used together with Oracle, therefore it would be great if you could add support for Windows in your library.

@felipenoris
Copy link
Owner

This is something I need for a long time, but don't have the skills to implement. Basically we need a jll package in BinaryBuilder that builds ODPI-C along with the patch in deps/dpi_patch.c. See #2 .

@felipenoris felipenoris added the enhancement New feature or request label Feb 5, 2021
@felipenoris felipenoris added the help wanted Extra attention is needed label Feb 27, 2021
@hhaensel
Copy link

I succeeded in compiling with BinaryBuilder from the linux sources, but I have no clue how to achieve this for windows.
There is no configure file that could serve for easy adaptiation of the dest dir but only two demo makefiles for unix and windows. In order to have make compile successfully I introduced a patch file that changes the prefix variable in the makefile.
If someone has a clue on how to go on with Windows we could combine the two approaches and have a odpi_jll.

@felipenoris
Copy link
Owner

Visual Studio is required to compile odpi for windows AFAIK.

@felipenoris
Copy link
Owner

But a linux/mac odpijll would be helpful

@hhaensel
Copy link

Short instruction: BinaryBuilder.run_wizard(), added LLVM as binary dependency and changed the prefix to $workstation/destdir.
Longer instruction:

julia> using BinaryBuilder

julia> BinaryBuilder.run_wizard()
Would you like to resume the previous incomplete wizard run?
   Resume previous run
 > Start from scratch

    o      `.
   o*o      \'-_               00000000: 01111111  .
     \\      \;"".     ,;.--*  00000001: 01000101  E
      \\     ,\''--.--'/       00000002: 01001100  L
      :=\--<' `""  _   |       00000003: 01000110  F
      ||\\     `" / ''--       00000004: 00000010  .
      `/_\\,-|    |            00000005: 00000001  .
          \\/     L
           \\ ,'   \
         _/ L'   `  \          Join us in the #binarybuilder channel on the
        /  /    /   /          community slack: https://julialang.slack.com
       /  /    |    \
      "_''--_-''---__=;        https://github.com/JuliaPackaging/BinaryBuilder.jl

Welcome to the BinaryBuilder wizard.  We'll get you set up in no time.

                        # Step 1: Select your platforms

Make a platform selection
   All Supported Platforms
   Select by Operating System
 > Fully Custom Platform Choice

Select platforms
[press: d=done, a=all, n=none]
   [ ] Platform("i686", "linux"; libc = "glibc")
 > [X] Platform("x86_64", "linux"; libc = "glibc")
   [ ] Platform("aarch64", "linux"; libc = "glibc")
   [ ] Platform("armv7l", "linux"; call_abi = "eabihf", libc = "glibc")
   [ ] Platform("powerpc64le", "linux"; libc = "glibc")
   [ ] Platform("i686", "linux"; libc = "musl")
   [ ] Platform("x86_64", "linux"; libc = "musl")
   [ ] Platform("aarch64", "linux"; libc = "musl")
   [ ] Platform("armv7l", "linux"; call_abi = "eabihf", libc = "musl")
v  [ ] Platform("x86_64", "macos"; )

                        # Step 2a: Obtain the source code

Please enter a URL (git repository or compressed archive) containing the source code to build:
> https://github.com/oracle/odpi/archive/refs/tags/v4.2.1.tar.gz


Would you like to download additional sources?  [y/N]: N

                        # Step 2b: Obtain binary dependencies (if any)

Do you require any (binary) dependencies?  [y/N]: y
Enter JLL package name:
> LLVM
    Updating registry at `~/.julia/registries/General`
Would you like to provide additional dependencies?  [y/N]: n

[ Info: Updating bare Yggdrasil clone in deps/Yggdrasil...
Enter a name for this project.  This will be used for filenames:
> odpi

Enter a version number for this project:
> 0.1.0

Do you want to customize the set of compilers? [y/N]: n
                        # Step 3: Build for Linux x86_64 {libc=glibc}

You will now be dropped into the cross-compilation environment.
Please compile the package. Your initial compilation target is x86_64-linux-gnu
The $prefix environment variable contains the target directory.
Once you are done, exit by typing `exit` or `^D`

   Resolving package versions...
    Updating `/tmp/jl_h4CdDo/3dum9ETy/x86_64-linux-gnu-libgfortran3-cxx03/.project/Project.toml`
  [86de99a1] + LLVM_jll v12.0.1+0
    Updating `/tmp/jl_h4CdDo/3dum9ETy/x86_64-linux-gnu-libgfortran3-cxx03/.project/Manifest.toml`

[...]

You have the following contents in your working directory:
  - odpi-4.2.1

sandbox:${WORKSPACE}/srcdir # cd odpi-4.2.1/

With a normal configure file you would now enter

./configure --prefix=$prefix --build=${MACHTYPE} --host=${target}
make -j${nproc}
make install

But here I left out configure (as it does not exist) opened the Makefile with vi, changed the prefix to $(WORKSPACE)/destdir, saved and quit. Then

make -j${nproc}
make install

So at this point no cross-compilation can be done. As I'm not a linux guy I put no further effort here and just hit Ctrl-d to quit the is part of the wizard.
I accepted the patch, named it prefix.patch and the library was build successfully.
Maybe someone more experienced in compiling on a linux system could help out here ... ?
Could crosscompiling for a windows machine work in this case ... ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants