Commit Graph

475 Commits

Author SHA1 Message Date
yangyanzhan
2994dd6377 Fix python support problems caused by building script errors.
Summary:
When trying to build caffe2 with python provided by homebrew, I find out there are some errors in the building scripts. The "get_python_cmake_flags.py" script is supposed to find out the correct python library and header file locations. However, due to these errors, this script does not function correctly. After building, caffe2 is linked against the default python library provided by Apple which causes a crash when trying to validate whether or not the installation is successful:
```shell
python -c 'from caffe2.python import core' 2>/dev/null && echo "Success" || echo "Failure"
```
The fix is as simple as follows:

- Add "shell" so that command substitution could work under Makefile.

- Add blank spaces between -D options so that they are treated as options not makefile targets.

- Print the "flags" variable without the newline character so that they could be utilized by command substitution correctly.
Closes https://github.com/caffe2/caffe2/pull/391

Differential Revision: D4943212

Pulled By: Yangqing

fbshipit-source-id: 04d3595fa2d89fe57aed5b6a7a91a95114a82a1b
2017-04-24 17:17:21 -07:00
Yangqing Jia
a48062b1a2 temporarily fix sync script bugs changes by reverting partially https://github.com/caffe2/caffe2/pull/266/files 2017-04-24 15:49:22 -07:00
Nay Oo
884690adb3 build_ios.sh comments fixes
Summary:
Changed _Android_ to _iOS_ in the comments in scripts/build_ios.sh.
Closes https://github.com/caffe2/caffe2/pull/364

Differential Revision: D4930101

Pulled By: Yangqing

fbshipit-source-id: 8f0a6aa1b43fd57c2f71f1c667c61d1f69b1e061
2017-04-21 10:52:29 -07:00
Yangqing Jia
9f86de2dc7 Support WatchOS build
Summary:
To build, run
`IOS_PLATFORM=WATCHOS scripts/build_ios.sh`
Closes https://github.com/caffe2/caffe2/pull/321

Reviewed By: Yangqing

Differential Revision: D4923400

Pulled By: salexspb

fbshipit-source-id: 3a87f068562a01e972ea915c9be32f0667e8ea19
2017-04-20 18:15:47 -07:00
Hannes Badertscher
9ef30b337e Add six to Tegra X1 install script
Summary:
When compiling Caffe2 on a Jetson TX2 using JetPack 3.0, the compilation with the Tegra X1 build script runs through perfectly fine. However, when running

    from caffe2.python import workspace

the following error shows up:

> ImportError: No module named six

After installing `six` manually using

    sudo pip install six

this works fine. I thus added the `six` module to the install script.

I assume this will also be required for the `build_raspbian.sh` script, however as I could test this, I didn't add it (yet).
Closes https://github.com/caffe2/caffe2/pull/293

Differential Revision: D4914121

Pulled By: Yangqing

fbshipit-source-id: 75947e8c295e1f5ad3f480a025fe8518dd91a957
2017-04-19 11:02:23 -07:00
Yangqing Jia
22f3825d8f Cmake mobile build improvements
Summary:
(1) integrate gcc compatible nnpack
(2) speed up the ios travis ci.
Closes https://github.com/caffe2/caffe2/pull/268

Differential Revision: D4897576

Pulled By: Yangqing

fbshipit-source-id: 729fa2e4b5be6f1d0b8d55305f047116969ff61f
2017-04-16 16:46:58 -07:00
Aaron Markham
b93a7b134a doxygen configs and updated python files to inc. doxygen tags (#266)
* updated ubuntu instructions

* updated ubuntu notes and troubleshooting

* updated tutorials using local files

* added doxygen python blocks for docs generation

* doxygen related files for generating docs
2017-04-14 16:30:33 -07:00
Bram Wasti
c101856214 Disable openmp when building for android
Summary: Closes https://github.com/caffe2/caffe2/pull/256

Reviewed By: salexspb

Differential Revision: D4853865

Pulled By: bwasti

fbshipit-source-id: 57768d538281bec2b18d8c6af7ae58009bbc257e
2017-04-07 14:35:01 -07:00
Yangqing Jia
92f2220589 Add whitelist capability for smaller mobile binaries
Summary:
This helps adjusting mobile build sizes when necessary.
Closes https://github.com/caffe2/caffe2/pull/228

Differential Revision: D4795135

Pulled By: Yangqing

fbshipit-source-id: 70a0dc35b31d5c8038081aedeb464e47e4284217
2017-03-29 08:47:08 -07:00
Aaron Markham
58f7f2b441 doxygen python block added
Summary: Closes https://github.com/caffe2/caffe2/pull/226

Differential Revision: D4793550

Pulled By: JoelMarcey

fbshipit-source-id: cc33e58186304fa8dcac2ee9115dcc271d785b1e
2017-03-29 06:46:16 -07:00
Yangqing Jia
463a28afcb Windows build for easier python usage
Summary:
Changed the windows python extension name to ".pyd" and did a manual copy from the {Debug,Release} folder to the main folder for easier automatic build.
Closes https://github.com/caffe2/caffe2/pull/222

Differential Revision: D4771065

Pulled By: Yangqing

fbshipit-source-id: 4a89d409fa66f0979cf4ecf502189b2f9cc11504
2017-03-24 11:33:27 -07:00
Yangqing Jia
aa4d07d3c4 bugfix for Windows, esp. VS 2017
Summary:
aaronmarkham this solves your Windows build issue. Basically:

(1) VS 2017 does not have CUDA support yet, and we will be waiting on NVidia to do so.

(2) VS 2015 and 2017 need different cmake generator strings.

This PR shows how to determine those and also updates appveyor to do contbuild guard for the following 3 settings:
- VS2015 without cuda
- VS2017 without cuda
- VS2015 with cuda
Closes https://github.com/caffe2/caffe2/pull/210

Differential Revision: D4745007

Pulled By: Yangqing

fbshipit-source-id: 50952552843abd0eb6f4145d9f132daeee3a6794
2017-03-21 05:17:59 -07:00
Yangqing Jia
1741fd839f Re-apply windows diff D4657831
Summary:
(Note: previous revert was due to a race condition between D4657831 and
D4659953 that I failed to catch.)

After this, we should have contbuild guarding the Windows build both with
and without CUDA.

This includes a series of changes that are needed to make Windows build,
specifically:

(1) Various flags that are needed in the cmake system, specially dealing
with /MD, /MT, cuda, cudnn, whole static linking, etc.
(2) Contbuild scripts based on appveyo.
(3) For Windows build, note that one will need to use "cmake --build" to
build stuff so that the build type is consistent between configuration and
actual build. see scripts\build_windows.bat for details.
(4) In logging.h, ERROR is already defined by Windows. I don't have a good
solution now, and as a result, LOG(ERROR) on windows is going to be
LOG(INFO).
(5) variable length array is not supported by MSVC (and it is not part of
C++ standard). As a result I replaced them with vectors.
(6) sched.h is not available on Windows, so akyrola 's awesome simple
async net might encounter some slowdown due to no affinity setting on
Windows.
(7) MSVC has a bug that does not work very well with template calls inide
a templated function call, which is a known issue that should be fixed in
MSVC 2017. However for now this means changes to conv_op_impl.h and
recurrent_net_op.h. No actual functionalities are changed.
(8) std host function calls are not supported in CUDA8+MSVC, so I changed
lp_pool (and maybe a few others) to use cuda device functions.
(9) The current Scale and Axpy has heavy templating that does not work
well with MSVC. As a result I reverted azzolini 's changes to the Scale
and Axpy interface, moved the fixed-length version to ScaleFixedSize and
AxpyFixedSize.
(10) CUDA + MSVC does not deal with Eigen well, so I guarded all Eigen
parts to only the non-CUDA part.
(11) In conclusion, it is fun but painful to deal with visual c++.

Differential Revision: D4666745

fbshipit-source-id: 3c9035083067bdb19a16d9c345c1ce66b6a86600
2017-03-07 11:02:12 -08:00
Avani Nandini
039c3cf0ba Revert D4657831: [caffe2][PR] Changes for Windows build to pass.
Summary: This reverts commit 070ded372ed78a7e3e3919fdffa1d337640f146e

Differential Revision: D4657831

fbshipit-source-id: 3a0fb403936a9257776d637ce3ba5dbd81e1119f
2017-03-06 21:02:36 -08:00
Yangqing Jia
7b8c7b11d2 Changes for Windows build to pass.
Summary:
After this, we should have contbuild guarding the Windows build both with
and without CUDA.

This includes a series of changes that are needed to make Windows build,
specifically:

(1) Various flags that are needed in the cmake system, specially dealing
with /MD, /MT, cuda, cudnn, whole static linking, etc.
(2) Contbuild scripts based on appveyo.
(3) For Windows build, note that one will need to use "cmake --build" to
build stuff so that the build type is consistent between configuration and
actual build. see scripts\build_windows.bat for details.
(4) In logging.h, ERROR is already defined by Windows. I don't have a good
solution now, and as a result, LOG(ERROR) on windows is going to be
LOG(INFO).
(5) variable length array is not supported by MSVC (and it is not part of
C++ standard). As a result I replaced them with vectors.
(6) sched.h is not available on Windows, so akyrola 's awesome simple
async net might encounter some slowdown due to no affinity setting on
Windows.
(7) MSVC has a
Closes https://github.com/caffe2/caffe2/pull/183

Reviewed By: ajtulloch

Differential Revision: D4657831

Pulled By: Yangqing

fbshipit-source-id: 070ded372ed78a7e3e3919fdffa1d337640f146e
2017-03-06 20:03:37 -08:00
Yangqing Jia
642b5a863f Adding changes that enable MSVC build
Summary:
MSVC 2015 has known bugs about template functions so these changes aim to fix them - no functional differences introduced.
Closes https://github.com/caffe2/caffe2/pull/179

Reviewed By: ajtulloch

Differential Revision: D4635241

Pulled By: Yangqing

fbshipit-source-id: a282a96e1e626e9440c1e3f3cb15b5b1fa710887
2017-03-01 16:47:58 -08:00
Bram Wasti
7a65736e46 Fix some python version issues with cmake
Summary:
This script will attempt to determine files that will be useful for building with the correct python version.  Currently on macOS with various python installations CMake fails to determine the correct location of python libraries.
Closes https://github.com/caffe2/caffe2/pull/163

Reviewed By: Yangqing

Differential Revision: D4594954

Pulled By: bwasti

fbshipit-source-id: c2b750ee9608a02fad4ce2f2293f5fa54dc7011c
2017-02-21 17:46:57 -08:00
Yangqing Jia
d4b1d347e9 minor: make cmake cuda ready
Summary: Closes https://github.com/caffe2/caffe2/pull/153

Differential Revision: D4571506

Pulled By: Yangqing

fbshipit-source-id: 4e887071774749fb84d34cab114dad4587d36ff1
2017-02-16 06:11:29 -08:00
Bram Wasti
7ee9984556 Added local build and apple fix for generating .so files
Summary: Closes https://github.com/caffe2/caffe2/pull/147

Reviewed By: bwasti

Differential Revision: D4564024

Pulled By: JoelMarcey

fbshipit-source-id: 526a5ab700f9356a3c93a6c64dc38e44a173559c
2017-02-16 06:11:28 -08:00
Yangqing Jia
e865c940a5 initial version of windows build
Summary:
This is essentially https://github.com/caffe2/caffe2/pull/146/ but shipit
failed to trigger task determinator.

Reviewed By: bwasti

Differential Revision: D4557698

fbshipit-source-id: b0e6777957e76df4e23671371098c2c6fe83b55c
2017-02-13 23:02:40 -08:00
Yangqing Jia
274ac2b590 Add cmake guard for python, build for tegra X1
Summary:
In short: cmake is lovely.
Closes https://github.com/caffe2/caffe2/pull/131

Differential Revision: D4517234

Pulled By: Yangqing

fbshipit-source-id: 1117878393f8fe7d6bebbc4a06a3c37b734f3222
2017-02-07 13:17:50 -08:00
Bram Wasti
8e1c513fb5 Make build_host_protoc more robust to weird system settings
Summary: If the PATH doesn't include cmake (such as when android studio wipes all the environment variables), this will still work.

Reviewed By: Yangqing

Differential Revision: D4504653

fbshipit-source-id: 56a8854e3daf6ee1f5b1cbeb83ca175a007dad12
2017-02-02 15:44:32 -08:00
Yangqing Jia
8553bd3f68 Ensure we are not using Eigen LGPL code, and build on raspbian.
Summary:
Turns out that building on raspbian is easy as a cake for caffe2 - cmake is awesome.
Closes https://github.com/caffe2/caffe2/pull/112

Differential Revision: D4480985

Pulled By: Yangqing

fbshipit-source-id: 5dbe5e1e71d8680dea7a5ec8a9ce7fbe6aa5270a
2017-01-30 09:44:27 -08:00
Yangqing Jia
3a82b33f84 Use protobuf's own cmake scripts and add travis for ios
Summary: Closes https://github.com/caffe2/caffe2/pull/110

Differential Revision: D4475170

Pulled By: Yangqing

fbshipit-source-id: 5964db04186619ac563f516cb202c5e2ba543403
2017-01-28 13:29:32 -08:00
Yangqing Jia
01e860505b Cmake for android
Summary:
Added cmake for android script under scripts, and set up the travis contbuild target.
Closes https://github.com/caffe2/caffe2/pull/109

Reviewed By: bwasti

Differential Revision: D4468767

Pulled By: Yangqing

fbshipit-source-id: 709f3eb6be24727b0a989d0901dbf377871b122a
2017-01-26 18:14:30 -08:00