Padmassri / libyuv

Automatically exported from code.google.com/p/libyuv
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Unable to build with "Getting started" steps #442

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
System:

1. Window7 64 Bit
2. VS 2013 Update 4

What steps will reproduce the problem?
According to 
https://code.google.com/p/libyuv/wiki/GettingStarted

1. Download and install depot_tools following steps in 
https://sites.google.com/a/chromium.org/dev/developers/how-tos/install-depot-too
ls
2. Start cmd prompt with admin rights. Create folder libyuv (e.g. 
c:\vs\libs\libyuv)
3. Run gclient config http://libyuv.googlecode.com/svn/trunk
4. Run gclient sync
5. set GYP_DEFINES=target_arch=ia32
6. Run "call python gyp_libyuv -fninja -G msvs_version=2013 --depth=. 
libyuv_test.gyp" or "call python gyp_libyuv -fninja -G msvs_version=2013 
--depth=. libyuv.gyp"

Output -> 

C:\VS\Libs\libyuv\trunk>call python gyp_libyuv -fninja -G msvs_version=2013 
--depth=.
libyuv_test.gyp
Traceback (most recent call last):
  File "gyp_libyuv", line 23, in <module>
    import gyp_chromium
ImportError: No module named gyp_chromium

The python script gyp_libyuv tries to find the module gyp_chromium
in folder "<checkout_root>\build" ->
sys.path.insert(0, os.path.join(checkout_root, 'build'))

But this module is lokated in folder
"<checkout_root>\chromium\src\build"

7.
After inserting this line in to script:
sys.path.insert(0, os.path.join(checkout_root, 'chromium', 'src', 'build'))

the gyp_chromium module was found but another error popped out:

C:\VS\Libs\libyuv\trunk>call python gyp_libyuv -fninja -G msvs_version=2013 --de
pth=. libyuv_test.gyp
Please follow the instructions at http://www.chromium.org/developers/how-tos/bui
ld-instructions-windows
Traceback (most recent call last):
  File "gyp_libyuv", line 65, in <module>
    vs2013_runtime_dll_dirs = vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs()
  File "C:\VS\Libs\libyuv\trunk\chromium\src\build\vs_toolchain.py", line 34, in
 SetEnvironmentAndGetRuntimeDllDirs
    Update()
  File "C:\VS\Libs\libyuv\trunk\chromium\src\build\vs_toolchain.py", line 177, i
n Update
    subprocess.check_call(get_toolchain_args)
  File "C:\VS\Libs\depot_tools\python276_bin\lib\subprocess.py", line 540, in ch
eck_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['C:\\VS\\Libs\\depot_tools\\python276_b
in\\python.exe', 'C:\\VS\\Libs\\depot_tools\\win_toolchain\\get_toolchain_if_nec
essary.py', '--output-json', 'C:\\VS\\Libs\\libyuv\\trunk\\chromium\\src\\build\
\win_toolchain.json', 'ee7d718ec60c2dc5d255bbe325909c2021a7efef']' returned non-
zero exit status 1

9. set DEPOT_TOOLS_WIN_TOOLCHAIN=0
10. Rerun call python gyp_libyuv -fninja -G msvs_version=2013 --depth=. 
libyuv_test.gyp

No error any more

Original issue reported on code.google.com by wvogel1...@gmail.com on 19 May 2015 at 9:10

GoogleCodeExporter commented 9 years ago
I've seen that before, but it usually happens once... something to do with the 
initial gclient sync
I suspect the gclient sync, which calls gclient runhooks, expects set 
GYP_DEFINES=target_arch=ia32 to be set before the gclient sync?

9. set DEPOT_TOOLS_WIN_TOOLCHAIN=0
will use your installed version of Visual Studio.

Original comment by fbarch...@google.com on 19 May 2015 at 11:16

GoogleCodeExporter commented 9 years ago
My first attempt to reproduce the issue built successfully?  I followed your 
steps of creating 1 - 6.  I'll try again with no environment variables at all.

On step 4 - gclient sync
did it complete successfully?
from trunk folder, try doing it a second time and/or call gclient runhooks
and see if it does anything.

Original comment by fbarch...@chromium.org on 20 May 2015 at 5:41

GoogleCodeExporter commented 9 years ago
With a regular command prompt, you will get an error for gclient sync

On Windows, you now need to have administrator privileges for the shell running 
trunk/setup_links.py (or `gclient sync|runhooks`).
Please start another command prompt as Administrator and try again.
Error: Command c:\bin\depot_tools\python276_bin\python.exe trunk/setup_links.py 
returned non-zero exit status 1 in C:\vs\libs\libyuv

If you ignore that, the next step will fail with
C:\vs\libs\libyuv\trunk>if not exist out\Release\build.ninja timex call python 
gyp_libyuv -fninja -Gconfig=Release -Gmsvs_version=2013 libyuv_test.gyp
Traceback (most recent call last):
  File "gyp_libyuv", line 22, in <module>
    import gyp_chromium
ImportError: No module named gyp_chromium
TIMEX 308.00 ms, call python gyp_libyuv -fninja -Gconfig=Release 
-Gmsvs_version=2013 libyuv_test.gyp, returncode 1

Is that the issue?  Open your command prompt with right click -> Run as 
administer.
Once you have the initial gclient sync, you should be able to build with a 
regular shell.

Original comment by fbarch...@chromium.org on 20 May 2015 at 10:51

GoogleCodeExporter commented 9 years ago
No. Everything I've done with the command prompt I made with admin rights

Original comment by wvogel1...@gmail.com on 21 May 2015 at 7:29

GoogleCodeExporter commented 9 years ago
I had a "gclient hooks" to run to get a folder "out".
For the first time I have got it at <checkout_root>\Chromium\src\out.
And when I've run 2 times ("gclient hooks"), I got it created under 
<checkout_root>\out.
But that's no matter now. I've already compiled.
The only thing what bother me -> I have no option
found for static linking. This is the option that a flag /Mt or /MTd 
corresponds in VS. This means that I have linking problems when using the 
Library

Original comment by wvogel1...@gmail.com on 21 May 2015 at 7:55

GoogleCodeExporter commented 9 years ago
I'm still not able to reproduce your issue.
Using admin shell with C:\vs\libs\libyuv folder, the gclient sync worked and it 
calls runhooks.  Seems like your initial issue is something in glient sync 
and/or runhooks failing the first time.
Sounds like you got past it anyway?
I've updated Getting Started to mention the admin shell, since I did see your 
issue when I used a regular command prompt.

These initial steps of getting the code will change soon, to follow what 
chromium is moving to.  The best documentation is often chromium and/or webrtc 
build instructions, since libyuv is using chromium depot tools.

The MT/MTd issue has no great solution that I'm aware of; Those are the only 
build option as far as I know.  ML and MD are not supported.
If you change 'type': 'static_library', to 'shared_library' the library will be 
built as a dynamic library and your app can use the import library and dll.
Or you could use a different build system - a sln or makefile.  Simply include 
the source into your project.

Original comment by fbarch...@chromium.org on 21 May 2015 at 6:05

GoogleCodeExporter commented 9 years ago
Looks like you could modify the libyuv.gyp to use /MD

http://stackoverflow.com/questions/13469632/cant-get-node-gyp-to-create-windows-
solution-with-md

Original comment by fbarch...@chromium.org on 21 May 2015 at 6:07

GoogleCodeExporter commented 9 years ago
documentation updated, but there will be future changes in getting started as 
we move to new code repository (git?) and/or build (GN?).

Original comment by fbarch...@chromium.org on 28 May 2015 at 11:45